mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 13:25:43 +01:00
common/json: add a json helper for the new errcode type
This commit is contained in:
parent
42cd23092c
commit
e6f56765ca
@ -762,3 +762,9 @@ void json_add_tok(struct json_stream *result, const char *fieldname,
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
void json_add_errcode(struct json_stream *result, const char *fieldname,
|
||||
errcode_t code)
|
||||
{
|
||||
json_add_member(result, fieldname, false, "%"PRIerrcode, code);
|
||||
}
|
||||
|
@ -264,5 +264,9 @@ void json_add_preimage(struct json_stream *result, const char *fieldname,
|
||||
void json_add_tok(struct json_stream *result, const char *fieldname,
|
||||
const jsmntok_t *tok, const char *buffer);
|
||||
|
||||
/* Add an error code */
|
||||
void json_add_errcode(struct json_stream *result, const char *fieldname,
|
||||
errcode_t code);
|
||||
|
||||
|
||||
#endif /* LIGHTNING_COMMON_JSON_H */
|
||||
|
Loading…
Reference in New Issue
Block a user