@@ -1070,6 +1070,13 @@ parse_request(struct json_connection *jcon,
10701070 "Expected string for method" );
10711071 }
10721072
1073+ c -> json_cmd = find_cmd (jcon -> ld -> jsonrpc , buffer , method );
1074+ if (!c -> json_cmd ) {
1075+ return command_fail (
1076+ c , JSONRPC2_METHOD_NOT_FOUND , "Unknown command '%.*s'" ,
1077+ method -> end - method -> start , buffer + method -> start );
1078+ }
1079+
10731080 if (filter ) {
10741081 struct command_result * ret ;
10751082 ret = parse_filter (c , "filter" , buffer , filter );
@@ -1081,12 +1088,6 @@ parse_request(struct json_connection *jcon,
10811088 * actually just logging the id */
10821089 log_io (jcon -> log , LOG_IO_IN , NULL , c -> id , NULL , 0 );
10831090
1084- c -> json_cmd = find_cmd (jcon -> ld -> jsonrpc , buffer , method );
1085- if (!c -> json_cmd ) {
1086- return command_fail (
1087- c , JSONRPC2_METHOD_NOT_FOUND , "Unknown command '%.*s'" ,
1088- method -> end - method -> start , buffer + method -> start );
1089- }
10901091 if (!command_deprecated_in_ok (c , NULL ,
10911092 c -> json_cmd -> depr_start ,
10921093 c -> json_cmd -> depr_end )) {
0 commit comments