From 18ebbf72446e8c45fdfc5ae73a1c3b55d8f97377 Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Mon, 18 Mar 2024 17:01:07 -0400 Subject: [PATCH] Make blinded hop features optional per spec. The spec states that if these features are missing, we MUST process the message as if it were present and contained an empty array. --- lightning/src/blinded_path/payment.rs | 2 +- pending_changelog/blinded-hop-features-optional.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 pending_changelog/blinded-hop-features-optional.txt diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs index d28066ec4..0ed09a366 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -169,7 +169,7 @@ impl Readable for BlindedPaymentTlvs { short_channel_id, payment_relay: payment_relay.ok_or(DecodeError::InvalidValue)?, payment_constraints: payment_constraints.0.unwrap(), - features: features.ok_or(DecodeError::InvalidValue)?, + features: features.unwrap_or_else(BlindedHopFeatures::empty), })) } else { if payment_relay.is_some() || features.is_some() { return Err(DecodeError::InvalidValue) } diff --git a/pending_changelog/blinded-hop-features-optional.txt b/pending_changelog/blinded-hop-features-optional.txt new file mode 100644 index 000000000..f8967f127 --- /dev/null +++ b/pending_changelog/blinded-hop-features-optional.txt @@ -0,0 +1,5 @@ +## Bug Fixes + +* LDK previously would fail to forward an intermediate blinded payment + if the blinded hop features were absent, potentially breaking + interoperability. -- 2.39.5