pub const HTLC_FAIL_BACK_BUFFER: u32 = _; // 39u32Expand description
Number of blocks before confirmation at which we fail back an un-relayed HTLC or at which we refuse to accept a new HTLC.
This is used for a few separate purposes:
- if we’ve received an MPP HTLC to us and it expires within this many blocks and we are waiting on additional parts (or waiting on the preimage for any HTLC from the user), we will fail this HTLC,
- if we receive an HTLC within this many blocks of its expiry (plus one to avoid a race condition with the above), we will fail this HTLC without telling the user we received it,
(1) is all about protecting us - we need enough time to update the channel state before we hit CLTV_CLAIM_BUFFER, at which point we’d go on chain to claim the HTLC with the preimage.
(2) is the same, but with an additional buffer to avoid accepting an HTLC which is immediately in a race condition between the user connecting a block (which would fail it) and the user providing us the preimage (which would claim it).