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

Function command_done_err

plugins/libplugin.c:603–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601}
602
603struct command_result *command_done_err(struct command *cmd,
604 enum jsonrpc_errcode code,
605 const char *errmsg,
606 const struct json_out *data)
607{
608 struct json_stream *js = jsonrpc_stream_start(cmd);
609 assert(cmd->type == COMMAND_TYPE_NORMAL
610 || cmd->type == COMMAND_TYPE_CHECK);
611
612 json_object_start(js, "error");
613 json_add_jsonrpc_errcode(js, "code", code);
614 json_add_string(js, "message", errmsg);
615
616 if (data)
617 json_out_add_splice(js->jout, "data", data);
618 json_object_end(js);
619
620 return command_complete(cmd, js);
621}
622
623struct command_result *command_err_raw(struct command *cmd,
624 const char *json_str)

Callers 7

command_errFunction · 0.85
getrawblockbyheightFunction · 0.85
handle_errorFunction · 0.85
timeout_sent_invFunction · 0.85
command_failFunction · 0.85
handle_replyFunction · 0.85
json_funderupdateFunction · 0.85

Calls 7

jsonrpc_stream_startFunction · 0.85
json_object_startFunction · 0.85
json_add_jsonrpc_errcodeFunction · 0.85
json_out_add_spliceFunction · 0.85
json_object_endFunction · 0.85
command_completeFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected