Send splice_locked if necessary while reconnecting#3318
Merged
Conversation
When we lock a commitment while reconnecting, we currently have a bug where if we've sent our `channel_reestablish` but we haven't received the remote `channel_reestablish`, we will not send `splice_locked` which results in a mismatch in the expected number of `commit_sig` messages for our peer, triggering a force-close. We add a failing test that showcases this bug.
We now send `splice_locked` when we are in the `SYNCING` state when that makes sense. The logic is very similar to the `NORMAL` state, but we don't emit events that are meant to be used when the channel is ready to handle payments.
pm47
approved these changes
Jun 11, 2026
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.
When we lock a commitment while reconnecting (because the funding/splice transaction confirms or when we're using zero-conf), we currently have a bug where if we've sent our
channel_reestablishbut we haven't received the remotechannel_reestablish, we will not sendsplice_lockedwhich results in a mismatch in the expected number ofcommit_sigmessages for our peer, triggering a force-close.This is simply because we didn't handle the event correctly in the
SYNCINGstate: we used the same handler as theOFFLINEstate, in which we updated our internal state but didn't send any message out. We now sendsplice_lockedin that case, which fixes this issue.