Skip to content

Commit 903a8e4

Browse files
committed
Expand ANTI_REORG_DELAY docs to say its a library-wide assumption
1 parent 9fe03af commit 903a8e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: lightning/src/chain/channelmonitor.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,13 @@ pub(crate) const CLTV_CLAIM_BUFFER: u32 = 18;
232232
/// with at worst this delay, so we are not only using this value as a mercy for them but also
233233
/// us as a safeguard to delay with enough time.
234234
pub(crate) const LATENCY_GRACE_PERIOD_BLOCKS: u32 = 3;
235-
/// Number of blocks we wait on seeing a HTLC output being solved before we fail corresponding inbound
236-
/// HTLCs. This prevents us from failing backwards and then getting a reorg resulting in us losing money.
235+
/// Number of blocks we wait on seeing a HTLC output being solved before we fail corresponding
236+
/// inbound HTLCs. This prevents us from failing backwards and then getting a reorg resulting in us
237+
/// losing money.
238+
///
239+
/// Note that this is a library-wide security assumption. If a reorg deeper than this number of
240+
/// blocks occurs, counterparties may be able to steal funds or claims made by and balances exposed
241+
/// by a [`ChannelMonitor`] may be incorrect.
237242
// We also use this delay to be sure we can remove our in-flight claim txn from bump candidates buffer.
238243
// It may cause spurious generation of bumped claim txn but that's alright given the outpoint is already
239244
// solved by a previous claim tx. What we want to avoid is reorg evicting our claim tx and us not

0 commit comments

Comments
 (0)