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

Function jsonrpc_stream_fail

plugins/libplugin.c:462–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462struct json_stream *jsonrpc_stream_fail(struct command *cmd,
463 int code,
464 const char *err)
465{
466 struct json_stream *js = jsonrpc_stream_start(cmd);
467
468 assert(cmd->type == COMMAND_TYPE_NORMAL
469 || cmd->type == COMMAND_TYPE_CHECK);
470 json_object_start(js, "error");
471 json_add_primitive_fmt(js, "code", "%d", code);
472 json_add_string(js, "message", err);
473 cmd->filter = tal_free(cmd->filter);
474
475 return js;
476}
477
478struct json_stream *jsonrpc_stream_fail_data(struct command *cmd,
479 int code,

Callers 5

on_payment_failureFunction · 0.70
payment_finishedFunction · 0.70
jsonrpc_stream_fail_dataFunction · 0.70
reckless_resultFunction · 0.70
reckless_failFunction · 0.70

Calls 5

jsonrpc_stream_startFunction · 0.85
json_object_startFunction · 0.85
json_add_primitive_fmtFunction · 0.85
tal_freeFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected