Track HTLC-Success/HTLC-Timeout claims of revoked outputs
authorMatt Corallo <git@bluematt.me>
Thu, 19 May 2022 01:50:37 +0000 (01:50 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 15 Aug 2022 23:18:12 +0000 (23:18 +0000)
commit9469ce0f3877843997f382da2e04e603335e37d7
tree644c907d84432baf06176ec6a884fece0d489cc4
parente76ac333304c4080f56f7931ec555d3a1f8269af
Track HTLC-Success/HTLC-Timeout claims of revoked outputs

When a counterparty broadcasts a revoked commitment transaction,
followed immediately by HTLC-Success/-Timeout spends thereof, we'd
like to have an `onchain_events_awaiting_threshold_conf` entry
for them.

This does so using the `HTLCSpendConfirmation` entry, giving it
(slightly) new meaning. Because all existing uses of
`HTLCSpendConfirmation` already check if the relevant commitment
transaction is revoked first, this should be trivially backwards
compatible.

We will ultimately figure out if something is being spent via the
`OnchainTxHandler`, but to do so we need to look up the output via
the HTLC transaction txid, which this allows us to do.
lightning/src/chain/channelmonitor.rs