mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
peer_control: Have listpeers also return channel ID.
This commit is contained in:
parent
099acb2a66
commit
d49915cdd2
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue