Closed optout21 closed 1 month ago
We shouldn't keep broadcasting forever, but I think we can trivially solve that by just checking if the funding tx has confirmed before broadcasting?
We shouldn't keep broadcasting forever, but I think we can trivially solve that by just checking if the funding tx has confirmed before broadcasting?
Is that what is checked immediately below where the funding tx was previously taken?
Or are there other places we'd need to worry about?
Is that what is checked immediately below where the funding tx was previously taken?
Not quite, that will keep broadcasting forever if the channel is 0conf or keep broadcasting after the funding is confirmed at minimum_depth - 1
confirmations, which is a bit weird.
Not quite, that will keep broadcasting forever if the channel is 0conf or keep broadcasting after the funding is confirmed at
minimum_depth - 1
confirmations, which is a bit weird.
Indeed, once the funding transaction is confirmed, it makes no sense to rebroadcast, funding_tx_confirmation_height
is not checked here.
I think with just that change I'd be happy with this PR :)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Changed the test for preventing re-broadcast to look whether the funding transaction is confirmed or not (instead of looking at ChannelReady state). With this, the test updated had to be reverted, the behavior is the same as before.
Addressed @jkczyz 's comments; not yet squashed
Squashed with no changes
Fixes #3300
In splicing, the funding transaction (not just the ID) is needed during splice negotiation. Funding transaction is kept in field
ChannelContext.funding_transaction
. However, the way it is currently used is that it is cleared when the tx is broadcast, and this fact is used in some logic.This change:
ChannelContext.funding_transaction
when tx is broadcast, but it's preserved (it's never reset)close_on_unfunded_channel
)Note that in some cases the funding transaction may get broadcasted more than once, which is a change in behavior.
Alternative is to preserve behavior, with some extra field, #3317 .