lightning
lightning copied to clipboard
pay: Enforce maxdelay for direct channel payments
Fixes #8609
When paying through a direct channel, direct_pay_override() creates a route bypassing the normal routing path, which skips the CLTV budget check in payment_getroute(). This allows payments to succeed even when maxdelay is set below the required min_final_cltv_expiry.
Add a check in direct_pay_override() to verify the required CLTV doesn't exceed cltv_budget before using the direct channel shortcut.
BTW, our plan is to deprecate pay in favor of xpay....
ACK https://github.com/ElementsProject/lightning/pull/8740/commits/b0a4743697d19b158ef3092b12cf33ab7b857122