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

Function jsonrpc_stream_fail

plugins/libplugin.c:452–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452struct json_stream *jsonrpc_stream_fail(struct command *cmd,
453 int code,
454 const char *err)
455{
456 struct json_stream *js = jsonrpc_stream_start(cmd);
457
458 assert(cmd->type == COMMAND_TYPE_NORMAL
459 || cmd->type == COMMAND_TYPE_CHECK);
460 json_object_start(js, "error");
461 json_add_primitive_fmt(js, "code", "%d", code);
462 json_add_string(js, "message", err);
463 cmd->filter = tal_free(cmd->filter);
464
465 return js;
466}
467
468struct json_stream *jsonrpc_stream_fail_data(struct command *cmd,
469 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