| 421 | } |
| 422 | |
| 423 | static const struct json_command *find_cmd(const struct jsonrpc *rpc, |
| 424 | const char *buffer, |
| 425 | const jsmntok_t *tok) |
| 426 | { |
| 427 | struct json_command **commands = rpc->commands; |
| 428 | |
| 429 | for (size_t i = 0; i < tal_count(commands); i++) |
| 430 | if (json_tok_streq(buffer, tok, commands[i]->name)) |
| 431 | return commands[i]; |
| 432 | return NULL; |
| 433 | } |
| 434 | |
| 435 | /* This can be called directly on shutdown, even with unfinished cmd */ |
| 436 | static void destroy_command(struct command *cmd) |
no test coverage detected