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
queryroutes uses unrouteable final_cltv_delta value by default #3150
Comments
I don't think this is true. The second check compares the htlc expiry with the invoice cltv delta requirement. I indeed think the fix is to raise |
The only way the invoice cltv delta of an invoice can be configured with the cli with the addinvoice command is through the This doesn't happen with sendpayment since that command knows the invoice cltv delta as it decodes it from the passed-in payment request whereas the queryroutes call does not know the cltv delta for a payment hash. |
If the goal is for Thinking about it now, maybe the problem really is that the default doesn't make sense? That it should be a required parameter to force callers to think about it? |
Didn't even think about other implementations, I think it should be a required parameter. Also, is there a reason why the addinvoice cli command doesn't allow a user to directly specify the final cltv delta? |
Not that I am aware of. I think it would be useful to add as a parameter. And for I have seen myself patch |
Background
The
queryroutes
command uses thezpay32.DefaultFinalCltvDelta
value to extend to the final hop if none is specified with the request:lnd/routing/router.go
Lines 1398 to 1403 in 4068e78
However, using
sendtoroute
will fail on the exit hop withFinalExpiryTooSoon
because of the check here:lnd/invoices/invoiceregistry.go
Lines 534 to 540 in 4068e78
The
finalCltvRejectDelta
is 13 which is greater than the final cltv default of 9, so this will fail. Additionally, the default--bitcoin.timelockdelta
config option is 40, so the final cltv should be at least 40 or else the second check will probably fail given a user's configuration. This isn't a problem with theaddinvoice
command since that uses the--bitcoin.timelockdelta
value. This is a quick fix, so I can fix it once we decide on a fix.Your environment
lnd
: masterThe text was updated successfully, but these errors were encountered: