<p>TL;DR. You need to specify <code>--final_cltv_delta=144</code> option in the <code>lncli queryroutes</code> command.</p>

<p>Longer answer... When payment is routed through Lightning Network, each intermediate node has a potential ability to steal the funds being transferred. To prevent this from happening, intermediate nodes cannot move the money immediately, but only after a certain period of time. And within this period the funds can be claimed back by a legitimate owner.</p>

<p><code>final_cltv_delta</code> option specifies this period of time (measured in the number of blocks) for the last node in the chain of hops. When you query routes, the default value is small (I believe it was 9 at some point). But this value is not accepted by most <code>lnd</code> nodes, which require a longer period of <code>144</code> by default.</p>

CC BY-SA 4.0
2019-02-07T16:49:27.867Z
2019-02-07T16:49:27.867Z
Dmitry Laptev
<p>Attempting a payment through a predefined route using:</p>

<pre><code>lncli -network=testnet queryroutes 02e34c1b4c5f8e7419cf4d10e3bc9651d46dc1af68df6a7b81a24951a9192aa9c4 25000 | lncli -network=testnet sendtoroute -pay_hash=45b9255c8648c6c1f60e394e555f745af31ed7fab385d0cf9e82b62ce8e8dfba - 
</code></pre>

<p>Always give me back: </p>

<pre><code>{
    "payment_error": "FinalExpiryTooSoon",
    "payment_preimage": "",
    "payment_route": null
}
</code></pre>

<p>Regardless the expiry I set in the addinvoice command. 
Can someone clarify Why?
Moreover, how is it possible to use the sendtoroute command using the routes.json obtained before from the queryroutes command? </p>

CC BY-SA 4.0
2019-02-07T15:00:47.197Z
Could you try adding “--final_cltv_delta=144” option to your queryroutes command?
Dmitry Laptev
CC BY-SA 4.0
2019-02-07T16:11:15.533Z
Adding this option works!
Stefano Angieri
CC BY-SA 4.0
2019-02-07T16:50:20.563Z
Glad it helped. Added an explanation of why you need this and posted it as an answer.
Dmitry Laptev
<lightning-network><lightning-network-daemon><lightning-routing><micropaymentchannels><lncli>
How to send payment through a predefined route?
Stefano Angieri
# How to send payment through a predefined route?

(Asked by: username_0 on 2019-02-07)

Attempting a payment through a predefined route using:
lncli -network=testnet queryroutes 02e34c1b4c5f8e7419cf4d10e3bc9651d46dc1af68df6a7b81a24951a9192aa9c4 25000 | lncli -network=testnet sendtoroute -pay_hash=45b9255c8648c6c1f60e394e555f745af31ed7fab385d0cf9e82b62ce8e8dfba - 

Always give me back: 
{
    "payment_error": "FinalExpiryTooSoon",
    "payment_preimage": "",
    "payment_route": null
}

Regardless the expiry I set in the addinvoice command. 
Can someone clarify Why?
Moreover, how is it possible to use the sendtoroute command using the routes.json obtained before from the queryroutes command?

**Tags:** lightning-network, lightning-network-daemon, lightning-routing, micropaymentchannels, lncli

> **Comments:**
> **username_1**: Could you try adding “--final_cltv_delta=144” option to your queryroutes command?  
> **username_0**: Adding this option works!  
> **username_1**: Glad it helped. Added an explanation of why you need this and posted it as an answer.  

---

## 1 answers

### Answer by username_1 on 2019-02-07. Score: 4 | Accepted answer

TL;DR. You need to specify `--final_cltv_delta=144` option in the `lncli queryroutes` command.

Longer answer... When payment is routed through Lightning Network, each intermediate node has a potential ability to steal the funds being transferred. To prevent this from happening, intermediate nodes cannot move the money immediately, but only after a certain period of time. And within this period the funds can be claimed back by a legitimate owner.

`final_cltv_delta` option specifies this period of time (measured in the number of blocks) for the last node in the chain of hops. When you query routes, the default value is small (I believe it was 9 at some point). But this value is not accepted by most `lnd` nodes, which require a longer period of `144` by default.


---

