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: add cltv limit #2640
routing: add cltv limit #2640
Conversation
532ffa0
to
8d284a5
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.
Somewhat unrelated -- I noticed that we check for the fee limit when constructing the route from the path. Is there a reason that check is still needed since we already do it within path finding?
8d284a5
to
e8a215a
Compare
I don't think there is. It is a sanity check, but I think it can be removed. I didn't bother adding another one for |
@wpaulino PTAL |
Gotcha, would be nice to remove it in a follow-up PR then. |
e8a215a
to
04e5c8d
Compare
Yes, I can do that. |
@wpaulino ptal |
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.
LGTM 🌵
@halseth comments replied to, ptal |
Rebased |
4738b27
to
d3ef006
Compare
It is happening in #2497 |
Needs a rebase. |
@@ -2836,6 +2837,11 @@ func extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPaymentIntent, error | |||
payIntent.outgoingChannelID = &rpcPayReq.OutgoingChanId | |||
} | |||
|
|||
// Take cltv limit from request if set. | |||
if rpcPayReq.CltvLimit != 0 { |
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.
This check wouldn't be needed if we used 0 to indicate no limit.
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.
It is the same discussion as above. The conversion is done as early as possible to prevent having to deal with the magic value further down the call stack.
This condition may be caused by a bug somewhere else in the system. Expose it here as a warn log line.
ptal |
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.
LGTM 🕺
This PR adds a maximum cltv limit for payments, similar to the currently existing fee limit.