Browse Source

listpeers: show channel direction for each outgoing channel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
plugin-timeout-inc
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
8738940a8f
  1. 1
      CHANGELOG.md
  2. 5
      lightningd/peer_control.c

1
CHANGELOG.md

@ -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

5
lightningd/peer_control.c

@ -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);

Loading…
Cancel
Save