Channel: add holding cell HTLC variant for blinded HTLCs.
authorValentine Wallace <vwallace@protonmail.com>
Fri, 27 Oct 2023 00:11:00 +0000 (20:11 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Tue, 12 Dec 2023 23:38:51 +0000 (18:38 -0500)
commitaf4d0df1bfcf1199772eb59fc8d4ab98798a69a4
treee1ffb43b613a1a10734b32df7832182d3ba00259
parente4485cffb3562e10de252894d18b4d4729cd2307
Channel: add holding cell HTLC variant for blinded HTLCs.

For context, blinded HTLCs where we are not the intro node must always be
failed back with malformed and invalid_onion_blinding error per BOLT 4.

Prior to supporting blinded payments, the only way for an update_malformed to
be returned from Channel was if an onion was actually found to be malformed
during initial update_add processing. This meant that any malformed HTLCs would
never live in the holding cell but instead would be returned directly upon
initial RAA processing.

Now, we need to be able to store these HTLCs in the holding cell because the
HTLC failure necessitating an update_malformed may come long after the RAA is
initially processed, and we may not be a state to send the update_malformed
message at that time.

Therefore, add a new holding cell HTLC variant for blinded non-intro node
HTLCs, which will signal to Channel to fail with malformed and the correct
error code.
lightning/src/ln/channel.rs