mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
listpeerchannels: only add the scratch_txid if it exists
Changelog-Changed: RPC `listpeerchannels`.`inflights` may sometimes not include `scratch_txid` (mandatory -> optional)
This commit is contained in:
parent
30babab1ed
commit
62de535619
3 changed files with 7 additions and 6 deletions
|
@ -56,7 +56,7 @@ On success, an object containing **channels** is returned. It is an array of ob
|
||||||
- **total\_funding\_msat** (msat): total amount in the channel
|
- **total\_funding\_msat** (msat): total amount in the channel
|
||||||
- **splice\_amount** (integer): The amouont of sats we're splicing in or out *(added v23.08)*
|
- **splice\_amount** (integer): The amouont of sats we're splicing in or out *(added v23.08)*
|
||||||
- **our\_funding\_msat** (msat): amount we have in the channel
|
- **our\_funding\_msat** (msat): amount we have in the channel
|
||||||
- **scratch\_txid** (txid): The commitment transaction txid we would use if we went onchain now
|
- **scratch\_txid** (txid, optional): The commitment transaction txid we would use if we went onchain now
|
||||||
- **close\_to** (hex, optional): scriptPubkey which we have to close to if we mutual close
|
- **close\_to** (hex, optional): scriptPubkey which we have to close to if we mutual close
|
||||||
- **private** (boolean, optional): if True, we will not announce this channel
|
- **private** (boolean, optional): if True, we will not announce this channel
|
||||||
- **closer** (string, optional): Who initiated the channel close (only present if closing) (one of "local", "remote")
|
- **closer** (string, optional): Who initiated the channel close (only present if closing) (one of "local", "remote")
|
||||||
|
@ -202,4 +202,4 @@ Main web site: <https://github.com/ElementsProject/lightning> Lightning
|
||||||
RFC site (BOLT \#9):
|
RFC site (BOLT \#9):
|
||||||
<https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md>
|
<https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md>
|
||||||
|
|
||||||
[comment]: # ( SHA256STAMP:d8f5d19a70fa3e8718e96369510ab8c9b28a0c0b626eb10321bfccb1cd7dbc0b)
|
[comment]: # ( SHA256STAMP:c4507febb0d592ac386f2e8bedbc88ab77d93f780e2d534d6c8d8064afbd6ee6)
|
||||||
|
|
|
@ -159,8 +159,7 @@
|
||||||
"feerate",
|
"feerate",
|
||||||
"total_funding_msat",
|
"total_funding_msat",
|
||||||
"splice_amount",
|
"splice_amount",
|
||||||
"our_funding_msat",
|
"our_funding_msat"
|
||||||
"scratch_txid"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"funding_txid": {
|
"funding_txid": {
|
||||||
|
|
|
@ -939,8 +939,10 @@ static void json_add_channel(struct lightningd *ld,
|
||||||
"splice_amount",
|
"splice_amount",
|
||||||
inflight->funding->splice_amnt);
|
inflight->funding->splice_amnt);
|
||||||
/* Add the expected commitment tx id also */
|
/* Add the expected commitment tx id also */
|
||||||
|
if (inflight->last_tx) {
|
||||||
bitcoin_txid(inflight->last_tx, &txid);
|
bitcoin_txid(inflight->last_tx, &txid);
|
||||||
json_add_txid(response, "scratch_txid", &txid);
|
json_add_txid(response, "scratch_txid", &txid);
|
||||||
|
}
|
||||||
json_object_end(response);
|
json_object_end(response);
|
||||||
}
|
}
|
||||||
json_array_end(response);
|
json_array_end(response);
|
||||||
|
|
Loading…
Add table
Reference in a new issue