| 1374 | } |
| 1375 | |
| 1376 | void jsonrpc_setup(struct lightningd *ld) |
| 1377 | { |
| 1378 | size_t num_cmdlist; |
| 1379 | struct json_command **commands = get_cmdlist(&num_cmdlist); |
| 1380 | |
| 1381 | ld->jsonrpc = tal(ld, struct jsonrpc); |
| 1382 | strmap_init(&ld->jsonrpc->cmdmap); |
| 1383 | for (size_t i=0; i<num_cmdlist; i++) { |
| 1384 | if (!jsonrpc_command_add_perm(ld, ld->jsonrpc, commands[i])) |
| 1385 | fatal("Cannot add duplicate command %s", |
| 1386 | commands[i]->name); |
| 1387 | } |
| 1388 | ld->jsonrpc->rpc_listener = NULL; |
| 1389 | tal_add_destructor(ld->jsonrpc, destroy_jsonrpc); |
| 1390 | memleak_add_helper(ld->jsonrpc, memleak_help_jsonrpc); |
| 1391 | } |
| 1392 | |
| 1393 | bool command_usage_only(const struct command *cmd) |
| 1394 | { |
no test coverage detected