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

Function command_add

lightningd/jsonrpc.c:1153–1164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1151}
1152
1153static bool command_add(struct jsonrpc *rpc, struct json_command *command)
1154{
1155 size_t count = tal_count(rpc->commands);
1156
1157 /* Check that we don't clobber a method */
1158 for (size_t i = 0; i < count; i++)
1159 if (streq(rpc->commands[i]->name, command->name))
1160 return false;
1161
1162 tal_arr_expand(&rpc->commands, command);
1163 return true;
1164}
1165
1166/* Built-in commands get called to construct usage string via param() */
1167static 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