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

Function command_done_err

plugins/libplugin.c:593–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591}
592
593struct command_result *command_done_err(struct command *cmd,
594 enum jsonrpc_errcode code,
595 const char *errmsg,
596 const struct json_out *data)
597{
598 struct json_stream *js = jsonrpc_stream_start(cmd);
599 assert(cmd->type == COMMAND_TYPE_NORMAL
600 || cmd->type == COMMAND_TYPE_CHECK);
601
602 json_object_start(js, "error");
603 json_add_jsonrpc_errcode(js, "code", code);
604 json_add_string(js, "message", errmsg);
605
606 if (data)
607 json_out_add_splice(js->jout, "data", data);
608 json_object_end(js);
609
610 return command_complete(cmd, js);
611}
612
613struct command_result *command_err_raw(struct command *cmd,
614 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