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

Function jsonrpc_command_add

lightningd/jsonrpc.c:1337–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

plugin_rpcmethod_addFunction · 0.85

Calls 3

command_addFunction · 0.85
json_escape_unescape_lenFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected