mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
common/json: add a json helper for the new errcode type
This commit is contained in:
parent
42cd23092c
commit
e6f56765ca
2 changed files with 10 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue