-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
routing: last hop restriction #3739
routing: last hop restriction #3739
Conversation
Previously both paths were equal cost, so it could also be a coincedence that the path with the outgoing restriction would be chosen.
9f28670
to
59ec4fe
Compare
59ec4fe
to
cc60ee8
Compare
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.
Very nice and clean PR! This will allow us to craft rebalance payments without external tools, right?
LGTM, there's only a small comment that is non-blocking.
190416d
to
a21c7d7
Compare
In combination with #3736 it does. Also we can use this to loop into a specific channel. |
@@ -1596,6 +1596,10 @@ type LightningPayment struct { | |||
// hop. If nil, any channel may be used. | |||
OutgoingChannelID *uint64 | |||
|
|||
// LastHop is the pubkey of the last node before the final destination | |||
// is reached. If nil, any node may be used. | |||
LastHop *route.Vertex |
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.
Do we care about validating whether this is an existing node in the graph? Path finding would result in unable to find a path to destination
, which can be ambiguous.
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.
We also don't do this for the outgoing channel restriction. As this is advanced functionality, I am ok with leaving it up to the caller to make sure this doesn't happen. What do you think?
Maybe if we start fixing #1680, we can add two new payment failures:
no_outgoing_channel
(with enough balance and not filtered out) and no_last_hop
(with enough capacity and not filtered out).
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.
We can defer it until then.
a21c7d7
to
f28941c
Compare
This PR adds an optional last hop restriction to payments.