Cancel previous commitment claims on newly confirmed commitment
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Tue, 31 Oct 2023 08:12:58 +0000 (01:12 -0700)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Tue, 12 Dec 2023 00:44:55 +0000 (16:44 -0800)
commit7dcee4f2e54988dbaceefad7a352bbd15263622b
tree3efba4e358d018891120a193ce1a4a2dadce8674
parent0c677533fc3055163c1768ef2211fbf7317d65ab
Cancel previous commitment claims on newly confirmed commitment

Once a commitment transaction is broadcast/confirms, we may need to
claim some of the HTLCs in it. These claims are sent as requests to the
`OnchainTxHandler`, which will bump their feerate as they remain
unconfirmed. When said commitment transaction becomes unconfirmed
though, and another commitment confirms instead, i.e., a reorg happens,
the `OnchainTxHandler` doesn't have any insight into whether these
claims are still valid or not, so it continues attempting to claim the
HTLCs from the previous commitment (now unconfirmed) forever, along with
the HTLCs from the newly confirmed commitment.
lightning/src/chain/channelmonitor.rs
lightning/src/chain/onchaintx.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/reorg_tests.rs