From: Valentine Wallace Date: Wed, 13 Mar 2024 19:46:12 +0000 (-0400) Subject: Parse keysend preimages in blinded onion payloads. X-Git-Tag: v0.0.123-beta~31^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=154aa211e68b1f7324c0cd542ef9b79796c80f13;p=rust-lightning Parse keysend preimages in blinded onion payloads. --- 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, }) }, }