Skip to content

Commit d49915c

Browse files
ZmnSCPxjcdecker
authored andcommitted
peer_control: Have listpeers also return channel ID.
1 parent 099acb2 commit d49915c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightningd/peer_control.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg,
635635
json_add_uncommitted_channel(response, p->uncommitted_channel);
636636

637637
list_for_each(&p->channels, channel, list) {
638+
struct channel_id cid;
638639
json_object_start(response, NULL);
639640
json_add_string(response, "state",
640641
channel_state_name(channel));
@@ -645,6 +646,13 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg,
645646
json_add_short_channel_id(response,
646647
"short_channel_id",
647648
channel->scid);
649+
derive_channel_id(&cid,
650+
&channel->funding_txid,
651+
channel->funding_outnum);
652+
json_add_string(response, "channel_id",
653+
type_to_string(tmpctx,
654+
struct channel_id,
655+
&cid));
648656
json_add_txid(response,
649657
"funding_txid",
650658
&channel->funding_txid);

0 commit comments

Comments
 (0)