From 154aa211e68b1f7324c0cd542ef9b79796c80f13 Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Wed, 13 Mar 2024 15:46:12 -0400 Subject: [PATCH] Parse keysend preimages in blinded onion payloads. --- lightning/src/ln/msgs.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index a30bea5d3..1958a3526 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -1688,6 +1688,7 @@ mod fuzzy_internal_msgs { payment_secret: PaymentSecret, payment_constraints: PaymentConstraints, intro_node_blinding_point: Option, + keysend_preimage: Option, } } @@ -2562,9 +2563,7 @@ impl ReadableArgs<(Option, &NS)> for InboundOnionPayload w } if let Some(blinding_point) = intro_node_blinding_point.or(update_add_blinding_point) { - if short_id.is_some() || payment_data.is_some() || payment_metadata.is_some() || - keysend_preimage.is_some() - { + if short_id.is_some() || payment_data.is_some() || payment_metadata.is_some() { return Err(DecodeError::InvalidValue) } let enc_tlvs = encrypted_tlvs_opt.ok_or(DecodeError::InvalidValue)?.0; @@ -2577,7 +2576,9 @@ impl ReadableArgs<(Option, &NS)> for InboundOnionPayload w ChaChaPolyReadAdapter { readable: BlindedPaymentTlvs::Forward(ForwardTlvs { short_channel_id, payment_relay, payment_constraints, features })} => { - if amt.is_some() || cltv_value.is_some() || total_msat.is_some() { + if amt.is_some() || cltv_value.is_some() || total_msat.is_some() || + keysend_preimage.is_some() + { return Err(DecodeError::InvalidValue) } Ok(Self::BlindedForward { @@ -2599,6 +2600,7 @@ impl ReadableArgs<(Option, &NS)> for InboundOnionPayload w payment_secret, payment_constraints, intro_node_blinding_point, + keysend_preimage, }) }, } -- 2.39.5