-
Notifications
You must be signed in to change notification settings - Fork 406
Do not return UpdateFailHTLC updates until the HTLC is committed #124
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
Merged
TheBlueMatt
merged 5 commits into
lightningdevkit:master
from
TheBlueMatt:2018-08-htlc-fail-spec
Aug 23, 2018
Merged
Do not return UpdateFailHTLC updates until the HTLC is committed #124
TheBlueMatt
merged 5 commits into
lightningdevkit:master
from
TheBlueMatt:2018-08-htlc-fail-spec
Aug 23, 2018
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
2590ee0
to
62ca481
Compare
ariard
reviewed
Aug 23, 2018
src/ln/channelmanager.rs
Outdated
return_err!("Forwarding channel is not in a ready state.", 0x1000 | 7, &chan_update.encode_with_len()[..]); | ||
} | ||
} | ||
} else { unreachable!(); } |
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.
Seems useless else branch for me, I build without it?
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.
Fixed.
62ca481
to
6d9085b
Compare
This fixes a violation of BOLT 2 and will let us consolidate some HTLC update handling. Good bit of code movement, but is mostly refactor to store HTLC failure status in pending_htlcs in Channel.
UpdateFailHTLC isn't really an error anymore now that its handled async after channel commitment (as required by BOLT 2), and since its unused this is free. To resolve the TODO which intended to use it for HTLC failure when trying to route forwards, we instead opt to merge all the HTLC update events into one UpdateHTLCs event which just contains a CommitmentUpdate object.
6d9085b
to
ab00e4c
Compare
TheBlueMatt
added a commit
to TheBlueMatt/rust-lightning
that referenced
this pull request
Aug 24, 2018
I'm rapidly starting to regret holding failed HTLCs in Channel, given we allow them to violate the no-duplicate-hashes precondition. Found by fuzzer
TheBlueMatt
added a commit
to TheBlueMatt/rust-lightning
that referenced
this pull request
Aug 24, 2018
I'm rapidly starting to regret holding failed HTLCs in Channel, given we allow them to violate the no-duplicate-hashes precondition. Found by fuzzer
TheBlueMatt
added a commit
that referenced
this pull request
Aug 26, 2018
Fix crash introduced in #124
TheBlueMatt
added a commit
to TheBlueMatt/rust-lightning
that referenced
this pull request
Aug 30, 2018
…tely fix Introduced in lightningdevkit#124, and found by fuzzer
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.
This fixes a violation of BOLT 2 and allows cleaning up some of the HTLC update event stuff. See individual commits for more.