| 1151 | } |
| 1152 | |
| 1153 | static bool command_add(struct jsonrpc *rpc, struct json_command *command) |
| 1154 | { |
| 1155 | size_t count = tal_count(rpc->commands); |
| 1156 | |
| 1157 | /* Check that we don't clobber a method */ |
| 1158 | for (size_t i = 0; i < count; i++) |
| 1159 | if (streq(rpc->commands[i]->name, command->name)) |
| 1160 | return false; |
| 1161 | |
| 1162 | tal_arr_expand(&rpc->commands, command); |
| 1163 | return true; |
| 1164 | } |
| 1165 | |
| 1166 | /* Built-in commands get called to construct usage string via param() */ |
| 1167 | static void setup_command_usage(struct lightningd *ld, |
no outgoing calls
no test coverage detected