Fix debug panic in onion utils on large custom TLVs or metadata.
authorValentine Wallace <vwallace@protonmail.com>
Wed, 22 Nov 2023 23:21:57 +0000 (18:21 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Fri, 8 Dec 2023 22:33:38 +0000 (17:33 -0500)
commite9bd893447d77e417ab7fed49365076ba390c495
tree0b0a2f5e67b908e13e707ee9cc464b8611bbea04
parentec8e0fe4784b758338145e8179db12c735ecd9de
Fix debug panic in onion utils on large custom TLVs or metadata.

We previously assumed that the final node's payload would be ~93 bytes, and had
code to ensure that the filler encoded after that payload is not all 0s. Now
with custom TLVs and metadata supported, the final node's payload may take up
the entire onion packet, so we can't assume that there are 64 bytes of filler
to check.
lightning/src/ln/onion_payment.rs
lightning/src/ln/onion_utils.rs
lightning/src/ln/payment_tests.rs