MCPcopy Create free account
hub / github.com/ElementsProject/lightning / jsonrpc_setup

Function jsonrpc_setup

lightningd/jsonrpc.c:1376–1391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1374}
1375
1376void 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
1393bool command_usage_only(const struct command *cmd)
1394{

Callers 1

new_lightningdFunction · 0.70

Calls 3

get_cmdlistFunction · 0.85
jsonrpc_command_add_permFunction · 0.85
fatalFunction · 0.70

Tested by

no test coverage detected