Skip to content

Commit

Permalink
listpeers: show channel direction for each outgoing channel.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Jan 15, 2019
1 parent be64dd8 commit 8738940
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- plugins: fully enabled, and ready for you to write some!
- lightning-cli: `help <cmd>` finds man pages even if `make install` not run.
- JSON API: `waitsendpay` now has an `erring_channel_direction` field.
- JSON API: `listpeers` now has a `channel_direction` field in `channels`.

### Changed

Expand Down
5 changes: 4 additions & 1 deletion lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,13 @@ static void json_add_peer(struct lightningd *ld,
if (channel->owner)
json_add_string(response, "owner",
channel->owner->name);
if (channel->scid)
if (channel->scid) {
json_add_short_channel_id(response,
"short_channel_id",
channel->scid);
json_add_num(response, "channel_direction",
pubkey_idx(&ld->id, &p->id));
}
derive_channel_id(&cid,
&channel->funding_txid,
channel->funding_outnum);
Expand Down

0 comments on commit 8738940

Please sign in to comment.