]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Rename InboundOnionPayload::BlindedReceive::amt_msat to be more descriptive.
authorValentine Wallace <vwallace@protonmail.com>
Thu, 14 Dec 2023 20:21:15 +0000 (15:21 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 10 Jan 2024 15:56:24 +0000 (10:56 -0500)
lightning/src/ln/msgs.rs
lightning/src/ln/onion_payment.rs

index 2b6a9ee105db986d4cb720a24ea2edd10d0fca70..39a2b2afa2c32e0ba78efb5875d840b6e28a82de 100644 (file)
@@ -1717,7 +1717,7 @@ mod fuzzy_internal_msgs {
                        intro_node_blinding_point: PublicKey,
                },
                BlindedReceive {
-                       amt_msat: u64,
+                       sender_intended_htlc_amt_msat: u64,
                        total_msat: u64,
                        cltv_expiry_height: u32,
                        payment_secret: PaymentSecret,
@@ -2400,7 +2400,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
                                })} => {
                                        if total_msat.unwrap_or(0) > MAX_VALUE_MSAT { return Err(DecodeError::InvalidValue) }
                                        Ok(Self::BlindedReceive {
-                                               amt_msat: amt.ok_or(DecodeError::InvalidValue)?,
+                                               sender_intended_htlc_amt_msat: amt.ok_or(DecodeError::InvalidValue)?,
                                                total_msat: total_msat.ok_or(DecodeError::InvalidValue)?,
                                                cltv_expiry_height: cltv_value.ok_or(DecodeError::InvalidValue)?,
                                                payment_secret,
index 875e530337e248d49ebfee57b3ad618ff685c185..c552bf13b8efd0fa80cd396d23e2f96da5c85eba 100644 (file)
@@ -132,10 +132,12 @@ pub(super) fn create_recv_pending_htlc_info(
                        (payment_data, keysend_preimage, custom_tlvs, sender_intended_htlc_amt_msat,
                         cltv_expiry_height, payment_metadata, false),
                msgs::InboundOnionPayload::BlindedReceive {
-                       amt_msat, total_msat, cltv_expiry_height, payment_secret, intro_node_blinding_point,
-                       payment_constraints, ..
+                       sender_intended_htlc_amt_msat, total_msat, cltv_expiry_height, payment_secret,
+                       intro_node_blinding_point, payment_constraints, ..
                } => {
-                       check_blinded_payment_constraints(amt_msat, cltv_expiry, &payment_constraints)
+                       check_blinded_payment_constraints(
+                               sender_intended_htlc_amt_msat, cltv_expiry, &payment_constraints
+                       )
                                .map_err(|()| {
                                        InboundHTLCErr {
                                                err_code: INVALID_ONION_BLINDING,
@@ -144,8 +146,8 @@ pub(super) fn create_recv_pending_htlc_info(
                                        }
                                })?;
                        let payment_data = msgs::FinalOnionHopData { payment_secret, total_msat };
-                       (Some(payment_data), None, Vec::new(), amt_msat, cltv_expiry_height, None,
-                        intro_node_blinding_point.is_none())
+                       (Some(payment_data), None, Vec::new(), sender_intended_htlc_amt_msat, cltv_expiry_height,
+                        None, intro_node_blinding_point.is_none())
                }
                msgs::InboundOnionPayload::Forward { .. } => {
                        return Err(InboundHTLCErr {