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

htlcswitch: fix non-strict forwarding failures #3547

Merged
merged 9 commits into from Oct 23, 2019

Conversation

joostjager
Copy link
Collaborator

@joostjager joostjager commented Sep 27, 2019

This PR fixes inconsistencies in the returned failure messages when forwarding non-strict.

@joostjager joostjager changed the title Non strict error htlcswitch: fix non-strict forwarding failures Sep 27, 2019
Copy link
Collaborator

@cfromknecht cfromknecht left a comment

Nice fix and refactor!

htlcswitch/link.go Outdated Show resolved Hide resolved
htlcswitch/link.go Show resolved Hide resolved
htlcswitch/interfaces.go Outdated Show resolved Hide resolved
htlcswitch/link.go Outdated Show resolved Hide resolved
htlcswitch/interfaces.go Outdated Show resolved Hide resolved
htlcswitch/switch.go Show resolved Hide resolved
htlcswitch/link.go Show resolved Hide resolved
@joostjager joostjager added this to the 0.9 milestone Oct 8, 2019
htlcswitch/link.go Outdated Show resolved Hide resolved
htlcswitch/interfaces.go Outdated Show resolved Hide resolved
htlcswitch/link_test.go Outdated Show resolved Hide resolved
htlcswitch/link.go Show resolved Hide resolved
htlcswitch/switch.go Show resolved Hide resolved
htlcswitch/interfaces.go Outdated Show resolved Hide resolved
@joostjager joostjager force-pushed the non-strict-error branch 5 times, most recently from acb7e9b to 8de45d9 Compare Oct 9, 2019
@joostjager joostjager requested a review from Roasbeef Oct 9, 2019
@joostjager joostjager requested a review from wpaulino Oct 21, 2019
Copy link
Member

@Roasbeef Roasbeef left a comment

LGTM ☄️

Needs a rebase, then ready to land!

}

// genIDs generates ids for two test channels.
func genIDs() (lnwire.ChannelID, lnwire.ChannelID, lnwire.ShortChannelID,
Copy link
Member

@Roasbeef Roasbeef Oct 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@joostjager joostjager added this to WIP in v0.9.0-beta via automation Oct 23, 2019
@joostjager joostjager moved this from WIP to Needs Review in v0.9.0-beta Oct 23, 2019
@joostjager joostjager moved this from Needs Review to Approved in v0.9.0-beta Oct 23, 2019
joostjager added 2 commits Oct 23, 2019
In the scenario where the requested channel does not have enough balance
and another channel towards the same node generates a different failure,
we erroneously returned UnknownNextPeer instead of the expected
TemporaryChannelFailure.

This commit rewrites the non-strict forwarding logic in the switch to
return the proper failure message. Part of this is moving the link
balance check inside the link.
@joostjager joostjager self-assigned this Oct 23, 2019
@joostjager joostjager merged commit 3cfd1eb into lightningnetwork:master Oct 23, 2019
1 of 2 checks passed
v0.9.0-beta automation moved this from Approved to Done Oct 23, 2019
@wpaulino wpaulino removed their request for review Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v0.9.0-beta
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants