lightning icon indicating copy to clipboard operation
lightning copied to clipboard

pay: maxdelay has no effect

Open ErikDeSmedt opened this issue 2 months ago • 3 comments

How to reproduce?

Create two lightning nodes and create a channel between them. I will call them cln1 and cln2. Create an invoice on cln2. I am using regtest and the default for min_final_cltv_delta=10

I pay the invoice using pay and set the max_delay=5.

Expected behavior

The payment fails because no route can be computed

Actual behavior

A HTLC is granted from client to server which exceeds max delay. The payment will succeed

Xpay is a work-around

It works as expected when using xpay

ErikDeSmedt avatar Oct 15 '25 09:10 ErikDeSmedt

Are you using the option xpay-handle-pay=true? Because that option will take any pay request and forward it to xpay.

Lagrang3 avatar Oct 20 '25 09:10 Lagrang3

I am not using that option. We migrated to use xpay everywhere

ErikDeSmedt avatar Oct 27 '25 13:10 ErikDeSmedt

It would be helpful to at least put a warning if max_delay is ignored. I used it to implement lightning based swaps and it is quite important for our security model.

ErikDeSmedt avatar Nov 03 '25 08:11 ErikDeSmedt