Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lightningd/jsonrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,13 @@ parse_request(struct json_connection *jcon,
"Expected string for method");
}

c->json_cmd = find_cmd(jcon->ld->jsonrpc, buffer, method);
if (!c->json_cmd) {
return command_fail(
c, JSONRPC2_METHOD_NOT_FOUND, "Unknown command '%.*s'",
method->end - method->start, buffer + method->start);
}

if (filter) {
struct command_result *ret;
ret = parse_filter(c, "filter", buffer, filter);
Expand All @@ -1081,12 +1088,6 @@ parse_request(struct json_connection *jcon,
* actually just logging the id */
log_io(jcon->log, LOG_IO_IN, NULL, c->id, NULL, 0);

c->json_cmd = find_cmd(jcon->ld->jsonrpc, buffer, method);
if (!c->json_cmd) {
return command_fail(
c, JSONRPC2_METHOD_NOT_FOUND, "Unknown command '%.*s'",
method->end - method->start, buffer + method->start);
}
if (!command_deprecated_in_ok(c, NULL,
c->json_cmd->depr_start,
c->json_cmd->depr_end)) {
Expand Down
Loading