Skip to content

Commit 9d29e98

Browse files
committed
BOLT 2: htlc-cltv must be in blocks.
ie. < 500 million. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent c3781c8 commit 9d29e98

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

02-peer-protocol.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,10 @@ is destined, is described in [BOLT #4](04-onion-routing.md).
582582

583583
A sending node MUST NOT offer `amount-msat` it cannot pay for in the
584584
remote commitment transaction at the current `fee-rate` (see "Updating
585-
Fees") while maintaining its channel reserve, and MUST offer
586-
`amount-msat` greater than 0, and MUST NOT offer `amount-msat` below
587-
the receiving node's `htlc-minimum-msat`.
585+
Fees") while maintaining its channel reserve, MUST offer
586+
`amount-msat` greater than 0, MUST NOT offer `amount-msat` below
587+
the receiving node's `htlc-minimum-msat`, and MUST set `cltv-expiry` less
588+
than 500000000.
588589

589590
A sending node MUST NOT add an HTLC if it would result in it offering
590591
more than the remote's `max-accepted-htlcs` HTLCs in the remote commitment
@@ -599,12 +600,13 @@ A receiving node SHOULD fail the channel if it receives an
599600
which the sending node cannot afford at the current `fee-rate` while
600601
maintaining its channel reserve. A receiving node SHOULD fail the
601602
channel if a sending node adds more than its `max-accepted-htlcs` HTLCs to
602-
its local commitment transaction, or adds more than its `max-htlc-value-in-flight-msat` worth of offered HTLCs to its local commitment transaction.
603+
its local commitment transaction, or adds more than its `max-htlc-value-in-flight-msat` worth of offered HTLCs to its local commitment transaction, or
604+
sets `cltv-expiry` to greater or equal to 500000000.
603605

604606
A receiving node MUST allow multiple HTLCs with the same payment hash.
605607

606608
A receiving node MUST ignore a repeated `id` value after a
607-
reconnection if it has the sender did not previously acknowledge the
609+
reconnection if the sender did not previously acknowledge the
608610
commitment of that HTLC. A receiving node MAY fail the channel if
609611
other `id` violations occur.
610612

@@ -635,6 +637,9 @@ still be under the maximum message size. It also ensures that
635637
a single penalty transaction can spend the entire commitment transaction,
636638
as calculated in [BOLT #5](05-onchain.md#penalty-transaction-weight-calculation).
637639

640+
`cltv-expiry` values equal or above 500000000 would indicate a time in
641+
seconds, and the protocol only supports an expiry in blocks.
642+
638643
### Removing an HTLC: `update_fulfill_htlc`, `update_fail_htlc` and `update_fail_malformed_htlc`
639644

640645
For simplicity, a node can only remove HTLCs added by the other node.

0 commit comments

Comments
 (0)