Remove redundant payment preimag hashing in HTLC claim pipeline 2023-08-earlier-payment-hash-log
authorMatt Corallo <git@bluematt.me>
Wed, 23 Aug 2023 03:30:56 +0000 (03:30 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 23 Aug 2023 16:45:15 +0000 (16:45 +0000)
commit5a1f212d03507e02e3acff185ec8440982fdaa14
tree328d97ce5dbc697044a6a166c8c3596adceb13ff
parent9e6992272972aa378677d9fd9f3bfa9628b84ff2
Remove redundant payment preimag hashing in HTLC claim pipeline

Currently, when we receive an HTLC claim from a peer, we first hash
the preimage they gave us before removing the HTLC, then
immediately pass the preimage to the inbound channel and hash the
preimage again before removing the HTLC and sending our peer an
`update_fulfill_htlc`. This second hash is actually only asserted
on, never used in any meaningful way as we have the htlc data
present in the same code.

Here we simply drop this second hash and move it into a
`debug_assert`.
lightning/src/ln/channel.rs