Repository navigation
Publish our commitment when a funding candidate confirms after mutual close - #71
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a mutual close, lightningd watches each pending funding candidate (a splice, or an earlier dual-funding attempt) and force closes if one of them confirms instead of the close. The callback passed the candidate's transaction to the failure path as if it were a commitment that had already closed the channel, so
drop_to_chain()logged "Not dropping our unilateral close onchain" and published nothing. The channel stayed inCLOSINGD_COMPLETEwith its funds in an output nothing was watching, until a restart.The callback now adopts the candidate the same way
funding_spent()does (crediting the splice amount and saving the channel), then fails the channel without a transaction, so our commitment on the new funding output is published. It does nothing if the candidate was already adopted, for example when a reorg mines it again.channel_apply_scid()no longer changes an existing scid once the channel is closing. After a restart, the funding watch on the adopted output computed a new scid, and changing it on a channel gossip already considers dying logged a broken gossip state transition.Tests:
test_splice_confirms_after_mutual_close(v1 and dual-funded): a splice confirms in place of the mutual close; checks the funding, the balance including the splice-in, a restart within the rescan window, a restart past it that rebroadcasts our commitment, and the onchain resolution. It fails without this change.test_rbf_candidate_confirms_after_mutual_close: the first dual-funding attempt confirms in place of the bump the close spends. It fails without this change.Changelog-None