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

Function command_exec

lightningd/jsonrpc.c:631–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631static struct command_result *command_exec(struct json_connection *jcon,
632 struct command *cmd,
633 const char *buffer,
634 const jsmntok_t *request,
635 const jsmntok_t *params)
636{
637 struct command_result *res;
638
639 res = cmd->json_cmd->dispatch(cmd, buffer, request, params);
640
641 assert(res == &param_failed
642 || res == &complete
643 || res == &pending
644 || res == &unknown);
645
646 /* If they didn't complete it, they must call command_still_pending.
647 * If they completed it, it's freed already. */
648 if (res == &pending)
649 assert(cmd->pending);
650
651 /* The command might outlive the connection. */
652 if (jcon)
653 list_for_each(&jcon->commands, cmd, list)
654 assert(cmd->pending);
655
656 return res;
657}
658
659/* A plugin hook to take over (fail/alter) RPC commands */
660struct rpc_command_hook_payload {

Callers 2

replace_commandFunction · 0.85
rpc_command_hook_finalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected