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

Function command_add

lightningd/jsonrpc.c:1309–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1307}
1308
1309static struct cmd_and_usage *command_add(struct jsonrpc *rpc, struct json_command *command)
1310{
1311 struct cmd_and_usage *cmd;
1312
1313 /* Check that we don't clobber a method */
1314 if (strmap_get(&rpc->cmdmap, command->name))
1315 return NULL;
1316
1317 cmd = tal(rpc, struct cmd_and_usage);
1318 cmd->command = command;
1319 cmd->usage = NULL;
1320 strmap_add(&rpc->cmdmap, command->name, cmd);
1321 return cmd;
1322}
1323
1324/* Built-in commands get called to construct usage string via param() */
1325static 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