Skip to content

Commit 3934996

Browse files
committed
lightningd: add withheld flag to listpeerchannels and listclosedchannels.
Signed-off-by: Rusty Russell <[email protected]> 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 ff433a1 commit 3934996

File tree

12 files changed

+867
-791
lines changed

12 files changed

+867
-791
lines changed

.msggen.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2075,8 +2075,10 @@
20752075
"ListClosedChannels.closedchannels[].funding_fee_paid_msat": 15,
20762076
"ListClosedChannels.closedchannels[].funding_fee_rcvd_msat": 16,
20772077
"ListClosedChannels.closedchannels[].funding_outnum": 13,
2078+
"ListClosedChannels.closedchannels[].funding_psbt": 26,
20782079
"ListClosedChannels.closedchannels[].funding_pushed_msat": 17,
20792080
"ListClosedChannels.closedchannels[].funding_txid": 12,
2081+
"ListClosedChannels.closedchannels[].funding_withheld": 27,
20802082
"ListClosedChannels.closedchannels[].last_commitment_fee_msat": 23,
20812083
"ListClosedChannels.closedchannels[].last_commitment_txid": 22,
20822084
"ListClosedChannels.closedchannels[].last_stable_connection": 25,
@@ -2844,8 +2846,10 @@
28442846
"ListPeerChannels.channels[].funding.fee_paid_msat": 4,
28452847
"ListPeerChannels.channels[].funding.fee_rcvd_msat": 5,
28462848
"ListPeerChannels.channels[].funding.local_funds_msat": 2,
2849+
"ListPeerChannels.channels[].funding.psbt": 6,
28472850
"ListPeerChannels.channels[].funding.pushed_msat": 1,
2848-
"ListPeerChannels.channels[].funding.remote_funds_msat": 3
2851+
"ListPeerChannels.channels[].funding.remote_funds_msat": 3,
2852+
"ListPeerChannels.channels[].funding.withheld": 7
28492853
},
28502854
"ListpeerchannelsChannelsHtlcs": {
28512855
"ListPeerChannels.channels[].htlcs[].amount_msat": 3,
@@ -8350,6 +8354,10 @@
83508354
"added": "pre-v0.10.1",
83518355
"deprecated": null
83528356
},
8357+
"ListClosedChannels.closedchannels[].funding_psbt": {
8358+
"added": "v25.12",
8359+
"deprecated": null
8360+
},
83538361
"ListClosedChannels.closedchannels[].funding_pushed_msat": {
83548362
"added": "pre-v0.10.1",
83558363
"deprecated": null
@@ -8358,6 +8366,10 @@
83588366
"added": "pre-v0.10.1",
83598367
"deprecated": null
83608368
},
8369+
"ListClosedChannels.closedchannels[].funding_withheld": {
8370+
"added": "v25.12",
8371+
"deprecated": null
8372+
},
83618373
"ListClosedChannels.closedchannels[].last_commitment_fee_msat": {
83628374
"added": "pre-v0.10.1",
83638375
"deprecated": null
@@ -10342,6 +10354,10 @@
1034210354
"added": "v23.02",
1034310355
"deprecated": null
1034410356
},
10357+
"ListPeerChannels.channels[].funding.psbt": {
10358+
"added": "v25.12",
10359+
"deprecated": null
10360+
},
1034510361
"ListPeerChannels.channels[].funding.pushed_msat": {
1034610362
"added": "v23.02",
1034710363
"deprecated": null
@@ -10350,6 +10366,10 @@
1035010366
"added": "v23.02",
1035110367
"deprecated": null
1035210368
},
10369+
"ListPeerChannels.channels[].funding.withheld": {
10370+
"added": "v25.12",
10371+
"deprecated": null
10372+
},
1035310373
"ListPeerChannels.channels[].funding_outnum": {
1035410374
"added": "v23.02",
1035510375
"deprecated": null

cln-grpc/proto/node.proto

Lines changed: 4 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: 4 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: 8 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
@@ -18439,6 +18439,7 @@
1843918439
"total_htlcs_sent",
1844018440
"funding_txid",
1844118441
"funding_outnum",
18442+
"funding_withheld",
1844218443
"leased",
1844318444
"final_to_us_msat",
1844418445
"min_to_us_msat",
@@ -18591,6 +18592,13 @@
1859118592
"The PSBT (may be non-final or unsigned) we should use to open the channel, if any"
1859218593
]
1859318594
},
18595+
"funding_withheld": {
18596+
"type": "boolean",
18597+
"added": "v25.12",
18598+
"description": [
18599+
"True if we have not broadcast the funding transaction (see fundchannel_complete)."
18600+
]
18601+
},
1859418602
"leased": {
1859518603
"type": "boolean",
1859618604
"description": [
@@ -24341,6 +24349,13 @@
2434124349
"description": [
2434224350
"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."
2434324351
]
24352+
},
24353+
"withheld": {
24354+
"type": "boolean",
24355+
"added": "v25.12",
24356+
"description": [
24357+
"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."
24358+
]
2434424359
}
2434524360
}
2434624361
},

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

Lines changed: 790 additions & 790 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,10 @@ def listpeerchannels_channels_funding2py(m):
931931
"fee_paid_msat": amount2msat(m.fee_paid_msat), # PrimitiveField in generate_composite
932932
"fee_rcvd_msat": amount2msat(m.fee_rcvd_msat), # PrimitiveField in generate_composite
933933
"local_funds_msat": amount2msat(m.local_funds_msat), # PrimitiveField in generate_composite
934+
"psbt": m.psbt, # PrimitiveField in generate_composite
934935
"pushed_msat": amount2msat(m.pushed_msat), # PrimitiveField in generate_composite
935936
"remote_funds_msat": amount2msat(m.remote_funds_msat), # PrimitiveField in generate_composite
937+
"withheld": m.withheld, # PrimitiveField in generate_composite
936938
})
937939

938940

@@ -1088,8 +1090,10 @@ def listclosedchannels_closedchannels2py(m):
10881090
"funding_fee_paid_msat": amount2msat(m.funding_fee_paid_msat), # PrimitiveField in generate_composite
10891091
"funding_fee_rcvd_msat": amount2msat(m.funding_fee_rcvd_msat), # PrimitiveField in generate_composite
10901092
"funding_outnum": m.funding_outnum, # PrimitiveField in generate_composite
1093+
"funding_psbt": m.funding_psbt, # PrimitiveField in generate_composite
10911094
"funding_pushed_msat": amount2msat(m.funding_pushed_msat), # PrimitiveField in generate_composite
10921095
"funding_txid": hexlify(m.funding_txid), # PrimitiveField in generate_composite
1096+
"funding_withheld": m.funding_withheld, # PrimitiveField in generate_composite
10931097
"last_commitment_fee_msat": amount2msat(m.last_commitment_fee_msat), # PrimitiveField in generate_composite
10941098
"last_commitment_txid": hexlify(m.last_commitment_txid), # PrimitiveField in generate_composite
10951099
"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)