Correctly detect missing HTLCs when a local commitment tx was broadcast 2021-07-detect-htlcs-on-local-commitment
authorMatt Corallo <git@bluematt.me>
Sat, 31 Jul 2021 03:34:16 +0000 (03:34 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 9 Aug 2021 16:12:53 +0000 (16:12 +0000)
If we forward an HTLC to our counterparty, but we force-closed the
channel before our counterparty provides us an updated commitment
transaction, we'll end up with a commitment transaction that does
not contain the HTLC which we attempted to forward. In this case,
we need to wait `ANTI_REORG_DELAY` blocks and then fail back the
HTLC as there is no way for us to learn the preimage and the
confirmed commitment transaction paid us the value of the HTLC.

However, check_spend_holder_transaction did not do this - it
instead only looked for dust HTLCs in the confirmed commitment
transaction, paying no attention to what other HTLCs may exist that
are missed.

This will eventually lead to channel force-closure as the channel
on which we received the inbound HTLC to forward will be closed in
time for the initial sender to claim the HTLC on-chain.


No differences found