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

Function jsonrpc_setup

lightningd/jsonrpc.c:1378–1393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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