Skip to content

Commit 4f93543

Browse files
committed
lightningd: add withheld flag to listpeerchannels and listclosedchannels.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `listpeerchannels` `funding` object `withheld` flag, and `listclosedchannels` `funding_withheld` flags, indicating fundchannel_complete was called with the `withheld` parameter true.
1 parent 286d308 commit 4f93543

11 files changed

Lines changed: 839 additions & 787 deletions

File tree

.msggen.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,6 +2057,7 @@
20572057
"ListClosedChannels.closedchannels[].funding_psbt": 26,
20582058
"ListClosedChannels.closedchannels[].funding_pushed_msat": 17,
20592059
"ListClosedChannels.closedchannels[].funding_txid": 12,
2060+
"ListClosedChannels.closedchannels[].funding_withheld": 27,
20602061
"ListClosedChannels.closedchannels[].last_commitment_fee_msat": 23,
20612062
"ListClosedChannels.closedchannels[].last_commitment_txid": 22,
20622063
"ListClosedChannels.closedchannels[].last_stable_connection": 25,
@@ -2826,7 +2827,8 @@
28262827
"ListPeerChannels.channels[].funding.local_funds_msat": 2,
28272828
"ListPeerChannels.channels[].funding.psbt": 6,
28282829
"ListPeerChannels.channels[].funding.pushed_msat": 1,
2829-
"ListPeerChannels.channels[].funding.remote_funds_msat": 3
2830+
"ListPeerChannels.channels[].funding.remote_funds_msat": 3,
2831+
"ListPeerChannels.channels[].funding.withheld": 7
28302832
},
28312833
"ListpeerchannelsChannelsHtlcs": {
28322834
"ListPeerChannels.channels[].htlcs[].amount_msat": 3,
@@ -8275,6 +8277,10 @@
82758277
"added": "pre-v0.10.1",
82768278
"deprecated": null
82778279
},
8280+
"ListClosedChannels.closedchannels[].funding_withheld": {
8281+
"added": "v25.12",
8282+
"deprecated": null
8283+
},
82788284
"ListClosedChannels.closedchannels[].last_commitment_fee_msat": {
82798285
"added": "pre-v0.10.1",
82808286
"deprecated": null
@@ -10271,6 +10277,10 @@
1027110277
"added": "v23.02",
1027210278
"deprecated": null
1027310279
},
10280+
"ListPeerChannels.channels[].funding.withheld": {
10281+
"added": "v25.12",
10282+
"deprecated": null
10283+
},
1027410284
"ListPeerChannels.channels[].funding_outnum": {
1027510285
"added": "v23.02",
1027610286
"deprecated": null

cln-grpc/proto/node.proto

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-grpc/src/convert.rs

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-rpc/src/model.rs

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/msggen/msggen/schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18097,6 +18097,7 @@
1809718097
"total_htlcs_sent",
1809818098
"funding_txid",
1809918099
"funding_outnum",
18100+
"funding_withheld",
1810018101
"leased",
1810118102
"final_to_us_msat",
1810218103
"min_to_us_msat",
@@ -18249,6 +18250,13 @@
1824918250
"The PSBT (may be non-final or unsigned) we should use to open the channel, if any"
1825018251
]
1825118252
},
18253+
"funding_withheld": {
18254+
"type": "boolean",
18255+
"added": "v25.12",
18256+
"description": [
18257+
"True if we have not broadcast the funding transaction (see fundchannel_complete)."
18258+
]
18259+
},
1825218260
"leased": {
1825318261
"type": "boolean",
1825418262
"description": [
@@ -23999,6 +24007,13 @@
2399924007
"description": [
2400024008
"The PSBT (may be non-final or unsigned) we should use to open the channel, if any. This is initially from `fundchannel_complete`, but will be updated with if `sendpsbt` is called with an updated PSBT."
2400124009
]
24010+
},
24011+
"withheld": {
24012+
"type": "boolean",
24013+
"added": "v25.12",
24014+
"description": [
24015+
"True if `fundchannel_complete` told us it will not broadcast the funding transaction (so we know not to bother with any other onchain transactions in the case of this channel). This is set to false if `sendpsbt` is send on the above PSBT."
24016+
]
2400224017
}
2400324018
}
2400424019
},

contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Lines changed: 786 additions & 786 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/pyln-testing/pyln/testing/grpc2py.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ def listpeerchannels_channels_funding2py(m):
934934
"psbt": m.psbt, # PrimitiveField in generate_composite
935935
"pushed_msat": amount2msat(m.pushed_msat), # PrimitiveField in generate_composite
936936
"remote_funds_msat": amount2msat(m.remote_funds_msat), # PrimitiveField in generate_composite
937+
"withheld": m.withheld, # PrimitiveField in generate_composite
937938
})
938939

939940

@@ -1092,6 +1093,7 @@ def listclosedchannels_closedchannels2py(m):
10921093
"funding_psbt": m.funding_psbt, # PrimitiveField in generate_composite
10931094
"funding_pushed_msat": amount2msat(m.funding_pushed_msat), # PrimitiveField in generate_composite
10941095
"funding_txid": hexlify(m.funding_txid), # PrimitiveField in generate_composite
1096+
"funding_withheld": m.funding_withheld, # PrimitiveField in generate_composite
10951097
"last_commitment_fee_msat": amount2msat(m.last_commitment_fee_msat), # PrimitiveField in generate_composite
10961098
"last_commitment_txid": hexlify(m.last_commitment_txid), # PrimitiveField in generate_composite
10971099
"last_stable_connection": m.last_stable_connection, # PrimitiveField in generate_composite

doc/schemas/listclosedchannels.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"total_htlcs_sent",
4444
"funding_txid",
4545
"funding_outnum",
46+
"funding_withheld",
4647
"leased",
4748
"final_to_us_msat",
4849
"min_to_us_msat",
@@ -195,6 +196,13 @@
195196
"The PSBT (may be non-final or unsigned) we should use to open the channel, if any"
196197
]
197198
},
199+
"funding_withheld": {
200+
"type": "boolean",
201+
"added": "v25.12",
202+
"description": [
203+
"True if we have not broadcast the funding transaction (see fundchannel_complete)."
204+
]
205+
},
198206
"leased": {
199207
"type": "boolean",
200208
"description": [

doc/schemas/listpeerchannels.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@
509509
"description": [
510510
"The PSBT (may be non-final or unsigned) we should use to open the channel, if any. This is initially from `fundchannel_complete`, but will be updated with if `sendpsbt` is called with an updated PSBT."
511511
]
512+
},
513+
"withheld": {
514+
"type": "boolean",
515+
"added": "v25.12",
516+
"description": [
517+
"True if `fundchannel_complete` told us it will not broadcast the funding transaction (so we know not to bother with any other onchain transactions in the case of this channel). This is set to false if `sendpsbt` is send on the above PSBT."
518+
]
512519
}
513520
}
514521
},

lightningd/closed_channel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ static void json_add_closed_channel(struct json_stream *response,
6161
channel->push);
6262
if (channel->funding_psbt)
6363
json_add_psbt(response, "funding_psbt", channel->funding_psbt);
64+
json_add_bool(response, "funding_withheld", channel->withheld);
6465

6566
json_add_amount_sat_msat(response, "total_msat", channel->funding_sats);
6667
json_add_amount_msat(response, "final_to_us_msat", channel->our_msat);

0 commit comments

Comments
 (0)