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

Function command_add

lightningd/jsonrpc.c:1305–1318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1303}
1304
1305static struct cmd_and_usage *command_add(struct jsonrpc *rpc, struct json_command *command)
1306{
1307 struct cmd_and_usage *cmd;
1308
1309 /* Check that we don't clobber a method */
1310 if (strmap_get(&rpc->cmdmap, command->name))
1311 return NULL;
1312
1313 cmd = tal(rpc, struct cmd_and_usage);
1314 cmd->command = command;
1315 cmd->usage = NULL;
1316 strmap_add(&rpc->cmdmap, command->name, cmd);
1317 return cmd;
1318}
1319
1320/* Built-in commands get called to construct usage string via param() */
1321static void setup_command_usage(struct lightningd *ld,

Callers 2

jsonrpc_command_addFunction · 0.85
jsonrpc_command_add_permFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected