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

Function json_command_malformed

lightningd/jsonrpc.c:633–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

631}
632
633static void json_command_malformed(struct json_connection *jcon,
634 const char *id,
635 const char *error)
636{
637 /* NULL writer is OK here, since we close it immediately. */
638 struct json_stream *js = jcon_new_json_stream(jcon, jcon, NULL);
639
640 json_object_start(js, NULL);
641 json_add_string(js, "jsonrpc", "2.0");
642 json_add_primitive(js, "id", id);
643 json_object_start(js, "error");
644 json_add_jsonrpc_errcode(js, "code", JSONRPC2_INVALID_REQUEST);
645 json_add_string(js, "message", error);
646 json_object_end(js);
647 json_object_end(js);
648
649 json_stream_close(js, NULL);
650}
651
652void json_notify_fmt(struct command *cmd,
653 enum log_level level,

Callers 2

parse_requestFunction · 0.85
read_jsonFunction · 0.85

Calls 7

jcon_new_json_streamFunction · 0.85
json_object_startFunction · 0.85
json_add_primitiveFunction · 0.85
json_add_jsonrpc_errcodeFunction · 0.85
json_object_endFunction · 0.85
json_stream_closeFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected