mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
common/json_stream.c: provide explicit json_add_primitive_fmt and json_add_str_fmt routines.
Rather than a generic "add member", provide two routines: one which doesn't quote, and one which does. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
36a29fbfbc
commit
dbae5ae569
@@ -208,7 +208,7 @@ struct json_stream *jsonrpc_stream_fail(struct command *cmd,
|
||||
struct json_stream *js = jsonrpc_stream_start(cmd);
|
||||
|
||||
json_object_start(js, "error");
|
||||
json_add_member(js, "code", false, "%d", code);
|
||||
json_add_primitive_fmt(js, "code", "%d", code);
|
||||
json_add_string(js, "message", err);
|
||||
|
||||
return js;
|
||||
|
||||
Reference in New Issue
Block a user