Both in the Basic of Lightning Technology (BOLT) documents, and in the specification of lnd, there is a different treatment for the last channel in a route. In BOLT#2 it refers to a variable min_final_cltv_expiry
:
min_final_cltv_expiry
is the minimum difference between HTLC CLTV timeout and the current block height, for the terminal case (C).
This value is 9, as opposed to 144 for cltv_expiry_delta
.
This is most likely related with the output of a route when querying lnd, for example, suppose the route Alice -> Bob -> Carol -> Dave, routed from Alice: the output is:
$> lncli-alice queryroutes --dest=<Carol_pubkey> --amt=5 --num_max_routes=1
total_time_lock: 1443640
total_fees: 1
total_amt: 6
hops {
chan_id: <id_chan_alice_bob>
chan_capacity: <cap>
amt_to_forward: 6
expiry: 1443610
amt_to_forward_msat: 6000
fee_msat: 1
}
hops {
chan_id: <id_chan_bob_carol>
chan_capacity: <cap>
amt_to_forward: 5
fee: 1
expiry: 1443466
amt_to_forward_msat: 5000
fee_msat: 1000
}
hops {
chan_id: <id_chan_carol_dave>
chan_capacity: <cap>
amt_to_forward: 5
expiry: 1443466
amt_to_forward_msat: 5000
}
total_fees_msat: 1001
total_amt_msat: 6001
Notice the last two hops have the same expiry
value. Why is the last hop different with regard to the expiry?