Skip to content
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 fail messages *after* they are cross-signed #754

Merged
merged 3 commits into from
Jan 2, 2019

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Nov 15, 2018

We were previously handling UpdateFailHtlc and
UpdateFailMalformedHtlc similarly to UpdateFulfillHtlc, but that is
wrong:

  • a fulfill needs to be propagated as soon as possible, because it
    allows us to pull funds from upstream
  • a fail needs to be cross-signed downstream (=irrevocably confirmed)
    before forwarding it upstream, because it means that we won't
    be able to pull funds anymore. In other words we need to be absolutely
    sure that the htlc won't be fulfilled downstream if we fail it upstream,
    otherwise we risk losing money.

Also added tests.

We were previously handling `UpdateFailHtlc` and
`UpdateFailMalformedHtlc` similarly to `UpdateFulfillHtlc`, but that is
wrong:
- a fulfill needs to be propagated as soon as possible, because it
allows us to pull funds from upstream
- a fail needs to be cross-signed downstream (=irrevocably confirmed)
before forwarding it upstream, because it means that we won't
be able to pull funds anymore. In other words we need to be absolutely
sure that the htlc won't be fulfilled downstream if we fail it upstream,
otherwise we risk losing money.

Also added tests.
@pm47 pm47 requested a review from sstone November 15, 2018 08:48
@pm47 pm47 changed the title Relay fail message *after* it is cross-signed Relay UpdateFailHtlc/UpdateFailMalformedHtlc *after* there are cross-signed Nov 15, 2018
@pm47 pm47 changed the title Relay UpdateFailHtlc/UpdateFailMalformedHtlc *after* there are cross-signed Relay fail messages *after* they are cross-signed Nov 15, 2018
@pm47 pm47 merged commit 8887ac2 into master Jan 2, 2019
@pm47 pm47 deleted the relay-fail-cross-signed branch January 2, 2019 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants