Browse Source

listpeers: add 'scratch_txid' for the tx we would broadcast if necessary.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
json-streaming
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
7744c41521
  1. 2
      CHANGELOG.md
  2. 6
      lightningd/peer_control.c

2
CHANGELOG.md

@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- JSON API: `listpeers` has new field `scratch_txid`: the latest tx in channel.
### Changed
### Deprecated

6
lightningd/peer_control.c

@ -642,6 +642,12 @@ static void json_add_peer(struct lightningd *ld,
json_object_start(response, NULL);
json_add_string(response, "state",
channel_state_name(channel));
if (channel->last_tx) {
struct bitcoin_txid txid;
bitcoin_txid(channel->last_tx, &txid);
json_add_txid(response, "scratch_txid", &txid);
}
if (channel->owner)
json_add_string(response, "owner",
channel->owner->name);

Loading…
Cancel
Save