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

@@ -142,6 +142,13 @@ void json_add_node_id(struct json_stream *response,
json_add_hex(response, fieldname, id->k, sizeof(id->k));
}
void json_add_channel_id(struct json_stream *response,
const char *fieldname,
const struct channel_id *cid)
{
json_add_hex(response, fieldname, cid->id, sizeof(cid->id));
}
void json_add_pubkey(struct json_stream *response,
const char *fieldname,
const struct pubkey *key)