diff --git a/CHANGELOG.md b/CHANGELOG.md index d1f600084..4062798b1 100644 --- a/CHANGELOG.md +++ b/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 ` 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 diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index b11fe80b9..c8c2a42db 100644 --- a/lightningd/peer_control.c +++ b/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);