mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
listpeers: add 'scratch_txid' for the tx we would broadcast if necessary.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
5f059ef3fe
commit
7744c41521
@ -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
|
||||
|
@ -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…
Reference in New Issue
Block a user