json: add channel_id helper

This commit is contained in:
niftynei
2020-10-08 15:41:12 -05:00
committed by Rusty Russell
parent 4034d0c306
commit 3674de9865
3 changed files with 13 additions and 2 deletions

View File

@@ -89,6 +89,11 @@ void json_add_node_id(struct json_stream *response,
const char *fieldname,
const struct node_id *id);
/* '"fieldname" : "0289abcdef..."' or "0289abcdef..." if fieldname is NULL */
void json_add_channel_id(struct json_stream *response,
const char *fieldname,
const struct channel_id *cid);
/* '"fieldname" : <hexrev>' or "<hexrev>" if fieldname is NULL */
void json_add_txid(struct json_stream *result, const char *fieldname,
const struct bitcoin_txid *txid);