Skip to content

Commit 9036d7c

Browse files
committed
Specify max HTLC nLocktime for expiry_too_far
1 parent aad959a commit 9036d7c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

04-onion-routing.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ A node:
6262
* [Returning Errors](#returning-errors)
6363
* [Failure Messages](#failure-messages)
6464
* [Receiving Failure Codes](#receiving-failure-codes)
65+
* [`max_htlc_cltv` Selection](#max-htlc-cltv-selection)
6566
* [Test Vector](#test-vector)
6667
* [Returning Errors](#returning-errors)
6768
* [References](#references)
@@ -1325,7 +1326,7 @@ A _forwarding node_ MAY, but a _final node_ MUST NOT:
13251326
- report the `cltv_expiry` of the outgoing HTLC and the current channel setting for the outgoing
13261327
channel.
13271328
- return an `incorrect_cltv_expiry` error.
1328-
- if the `cltv_expiry` is unreasonably near the present:
1329+
- if the `cltv_expiry` is more than `max_htlc_cltv` near the present:
13291330
- report the current channel setting for the outgoing channel.
13301331
- return an `expiry_too_soon` error.
13311332
- if the `cltv_expiry` is unreasonably far in the future:
@@ -1407,6 +1408,13 @@ The _origin node_:
14071408
- MAY use the data specified in the various failure types for debugging
14081409
purposes.
14091410

1411+
## `max_htlc_cltv` Selection
1412+
1413+
If the HTLC expires too far in the future, a forwarding node can return an `expiry_too_far` error.
1414+
1415+
This `max_htlc_ctlv` value is defined by default to be 2016 blocks, based on historical default
1416+
deployed by Lightning implementations.
1417+
14101418
# Test Vector
14111419

14121420
## Returning Errors

0 commit comments

Comments
 (0)