From d49915cdd22e59880fcc6a0c9e83bd634b328775 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Fri, 16 Mar 2018 23:50:54 +0000 Subject: [PATCH] peer_control: Have listpeers also return channel ID. --- lightningd/peer_control.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 0fdba0b9a..7b6e14f11 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -635,6 +635,7 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg, json_add_uncommitted_channel(response, p->uncommitted_channel); list_for_each(&p->channels, channel, list) { + struct channel_id cid; json_object_start(response, NULL); json_add_string(response, "state", channel_state_name(channel)); @@ -645,6 +646,13 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg, json_add_short_channel_id(response, "short_channel_id", channel->scid); + derive_channel_id(&cid, + &channel->funding_txid, + channel->funding_outnum); + json_add_string(response, "channel_id", + type_to_string(tmpctx, + struct channel_id, + &cid)); json_add_txid(response, "funding_txid", &channel->funding_txid);