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

Function json_command_malformed

lightningd/jsonrpc.c:508–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508static void json_command_malformed(struct json_connection *jcon,
509 const char *id,
510 const char *error)
511{
512 /* NULL writer is OK here, since we close it immediately. */
513 struct json_stream *js = jcon_new_json_stream(jcon, jcon, NULL);
514
515 json_object_start(js, NULL);
516 json_add_string(js, "jsonrpc", "2.0");
517 json_add_primitive(js, "id", id);
518 json_object_start(js, "error");
519 json_add_jsonrpc_errcode(js, "code", JSONRPC2_INVALID_REQUEST);
520 json_add_string(js, "message", error);
521 json_object_end(js);
522 json_object_end(js);
523
524 json_stream_close(js, NULL);
525}
526
527void json_notify_fmt(struct command *cmd,
528 enum log_level level,

Callers 2

parse_requestFunction · 0.85
read_jsonFunction · 0.85

Calls 7

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

Tested by

no test coverage detected