<p>This was answered by Christian Decker on Telegram.</p>
<blockquote>
<p>At each hop the node forwarding the payment will require to increase the CLTV delay. This is used so it can settle the downstream HTLC, turn around and still be in time to settle the upstream HTLC. The sum of these delays is the maximum time that funds may be locked if the HTLC is stuck, and so it is important to set up a maximum delay (so you get your funds back in a reasonable amount of time). On the flip side, setting that delay too low will result in some possible routes not being selected, as they'd exceed that delay. If not set, pay will use the <code>--max-locktime-blocks</code> option's value, which defaults to 2016 blocks (14 days).</p>
</blockquote>

CC BY-SA 4.0
2023-05-01T20:01:07.567Z
2023-05-01T20:01:07.567Z
Michael Folkson
<p>What would <code>maxdelay</code> practically be used for in the Core Lightning <a href="https://github.com/ElementsProject/lightning/blob/master/plugins/pay.c" rel="nofollow noreferrer">pay</a> plugin?</p>
<p>This was asked on Telegram.</p>

<core-lightning><plugins>
What would maxdelay practically be used for in the Core Lightning pay plugin?
Michael Folkson
# What would maxdelay practically be used for in the Core Lightning pay plugin?

(Asked by: username_0 on 2023-05-01)

What would `maxdelay` practically be used for in the Core Lightning [pay](https://github.com/ElementsProject/lightning/blob/master/plugins/pay.c) plugin?

This was asked on Telegram.

**Tags:** core-lightning, plugins


---

## 1 answers

### Answer by username_0 on 2023-05-01. Score: 2

This was answered by Christian Decker on Telegram.

> At each hop the node forwarding the payment will require to increase the CLTV delay. This is used so it can settle the downstream HTLC, turn around and still be in time to settle the upstream HTLC. The sum of these delays is the maximum time that funds may be locked if the HTLC is stuck, and so it is important to set up a maximum delay (so you get your funds back in a reasonable amount of time). On the flip side, setting that delay too low will result in some possible routes not being selected, as they'd exceed that delay. If not set, pay will use the `--max-locktime-blocks` option's value, which defaults to 2016 blocks (14 days).


---

