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

Function setup_command_usage

lightningd/jsonrpc.c:1167–1181  ·  view source on GitHub ↗

Built-in commands get called to construct usage string via param() */

Source from the content-addressed store, hash-verified

1165
1166/* Built-in commands get called to construct usage string via param() */
1167static void setup_command_usage(struct lightningd *ld,
1168 struct json_command *command)
1169{
1170 const struct command_result *res;
1171 struct command *dummy;
1172
1173 /* Call it with minimal cmd, to fill out usagemap */
1174 dummy = tal(tmpctx, struct command);
1175 dummy->mode = CMD_USAGE;
1176 dummy->ld = ld;
1177 dummy->json_cmd = command;
1178 res = command->dispatch(dummy, NULL, NULL, NULL);
1179 assert(res == &param_failed);
1180 assert(strmap_get(&ld->jsonrpc->usagemap, command->name));
1181}
1182
1183bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command,
1184 const char *usage TAKES)

Callers 1

jsonrpc_command_add_permFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected