htlcswitch: send an error before marking a channel w/ local data loss #7312
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.
Change Description
In this commit, we move to also send an error before we "fail" our channel when we realize that either we've lost data, or are recovering from some partial state.
This is the first half of the set of changes needed to fix: #6017. To start with, we'll ensure that the new lnd nodes always send the error once the receive a chan reest and determine that they're behind. In the second half of the fix, we'll start to hold off on force closing until the other party sends an error. We opt to do this in two parts as: there're many
lnd
nodes out there that still rely on the current behavior. Once we get another update cycle under our belt, we can start to catch up our behavior fully.Steps to Test
Interop test with Eclair+CLN+LDK to ensure that the SCB flow still works.
The SCB flow in this PR should also still work with the existing lnd node versions as well.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.
Fixes #7301