mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
listpeers: show the inflight's 'commitment tx' txid
Changelog-Added: EXPERIMENTAL JSON-RPC: `listpeers` now includes the `scratch_txid` for every inflight (if is a dual-funded channel)
This commit is contained in:
@@ -797,6 +797,8 @@ static void json_add_channel(struct lightningd *ld,
|
|||||||
/* List the inflights */
|
/* List the inflights */
|
||||||
json_array_start(response, "inflight");
|
json_array_start(response, "inflight");
|
||||||
list_for_each(&channel->inflights, inflight, list) {
|
list_for_each(&channel->inflights, inflight, list) {
|
||||||
|
struct bitcoin_txid txid;
|
||||||
|
|
||||||
json_object_start(response, NULL);
|
json_object_start(response, NULL);
|
||||||
json_add_txid(response, "funding_txid",
|
json_add_txid(response, "funding_txid",
|
||||||
&inflight->funding->txid);
|
&inflight->funding->txid);
|
||||||
@@ -813,6 +815,9 @@ static void json_add_channel(struct lightningd *ld,
|
|||||||
json_add_amount_sat_only(response,
|
json_add_amount_sat_only(response,
|
||||||
"our_funding_msat",
|
"our_funding_msat",
|
||||||
inflight->funding->our_funds);
|
inflight->funding->our_funds);
|
||||||
|
/* Add the expected commitment tx id also */
|
||||||
|
bitcoin_txid(inflight->last_tx, &txid);
|
||||||
|
json_add_txid(response, "scratch_txid", &txid);
|
||||||
json_object_end(response);
|
json_object_end(response);
|
||||||
}
|
}
|
||||||
json_array_end(response);
|
json_array_end(response);
|
||||||
|
|||||||
Reference in New Issue
Block a user