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

Function jsonrpc_command_add

lightningd/jsonrpc.c:1341–1355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339}
1340
1341bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command,
1342 const char *usage TAKES)
1343{
1344 struct cmd_and_usage *cmd;
1345
1346 cmd = command_add(rpc, command);
1347 if (!cmd) {
1348 tal_free_if_taken(usage);
1349 return false;
1350 }
1351
1352 cmd->usage = tal_strdup(cmd, usage);
1353 tal_add_destructor2(command, destroy_json_command, rpc);
1354 return true;
1355}
1356
1357static bool jsonrpc_command_add_perm(struct lightningd *ld,
1358 struct jsonrpc *rpc,

Callers 1

plugin_rpcmethod_addFunction · 0.85

Calls 2

command_addFunction · 0.85
tal_free_if_takenFunction · 0.85

Tested by

no test coverage detected