Skip to content

Commit

Permalink
Specify max HTLC nLocktime for expiry_too_far
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Riard committed Aug 12, 2023
1 parent fbd19ef commit 029028a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion 04-onion-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ A node:
* [Returning Errors](#returning-errors)
* [Failure Messages](#failure-messages)
* [Receiving Failure Codes](#receiving-failure-codes)
* [`max_htlc_cltv` Selection](#max-htlc-cltv-selection)
* [Onion Messages](#onion-messages)
* [Test Vector](#test-vector)
* [Returning Errors](#returning-errors)
Expand Down Expand Up @@ -1330,7 +1331,7 @@ A _forwarding node_ MAY, but a _final node_ MUST NOT:
- report the `cltv_expiry` of the outgoing HTLC and the current channel setting for the outgoing
channel.
- return an `incorrect_cltv_expiry` error.
- if the `cltv_expiry` is unreasonably near the present:
- if the `cltv_expiry` is more than `max_htlc_cltv` near the present:
- report the current channel setting for the outgoing channel.
- return an `expiry_too_soon` error.
- if the `cltv_expiry` is unreasonably far in the future:
Expand Down Expand Up @@ -1412,6 +1413,7 @@ The _origin node_:
- MAY use the data specified in the various failure types for debugging
purposes.

<<<<<<< HEAD
# Onion Messages

Onion messages allow peers to use existing connections to query for
Expand Down Expand Up @@ -1580,6 +1582,12 @@ Onion messages don't explicitly require a channel, but for
spam-reduction a node may choose to ratelimit such peers, especially
messages it is asked to forward.

## `max_htlc_cltv` Selection

If the HTLC expires too far in the future, a forwarding node can return an `expiry_too_far` error.

This `max_htlc_ctlv` value is defined by default to be 2016 blocks, based on historical default
deployed by Lightning implementations.

# Test Vector

Expand Down

0 comments on commit 029028a

Please sign in to comment.