-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relay partially failed htlcs when closing #1706
Conversation
If a channel closes when we've received an UpdateFailHtlc, signed it but not yet received our peer's revocation, we need to fail the htlc upstream. That specific scenario was not correctly handled, resulting in upstream htlcs that were not failed which would force our upstream peer to close the channel.
Codecov Report
@@ Coverage Diff @@
## master #1706 +/- ##
==========================================
- Coverage 86.18% 86.05% -0.13%
==========================================
Files 151 151
Lines 11527 11527
Branches 500 508 +8
==========================================
- Hits 9934 9920 -14
- Misses 1593 1607 +14
|
I don't think we can. What if the peer publishes its previous commitment (that isn't revoked) and uses the preimage? |
He can't, we waited for our local commit to be confirmed ;) |
Well then yes. Alright, you got me I didn't go past the PR description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I see how complex that corner case is and how simple and elegant the fix and the tests are, I think we can be proud of that codebase!
eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala
Outdated
Show resolved
Hide resolved
If a channel closes when we've received an UpdateFailHtlc, signed it but not yet received our peer's revocation, we need to fail the htlc upstream. That specific scenario was not correctly handled, resulting in upstream htlcs that were not failed which would force our upstream peer to close the channel.
If a channel closes when we've received an
UpdateFailHtlc
, signed it but not yet received our peer's revocation, we need to fail the htlc upstream.That specific scenario was not correctly handled, resulting in upstream htlcs that were not failed which would force our upstream peer to close the channel.
In that scenario the HTLC is in the
remoteCommit
but not in thenextRemoteCommit
.