From 2b1c9945121884ebb536afa00f4027cebe53adf4 Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Thu, 14 Dec 2023 15:21:15 -0500 Subject: [PATCH] Rename InboundOnionPayload::BlindedReceive::amt_msat to be more descriptive. --- lightning/src/ln/msgs.rs | 4 ++-- lightning/src/ln/onion_payment.rs | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 2b6a9ee10..39a2b2afa 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -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 ReadableArgs<(Option, &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, diff --git a/lightning/src/ln/onion_payment.rs b/lightning/src/ln/onion_payment.rs index 875e53033..c552bf13b 100644 --- a/lightning/src/ln/onion_payment.rs +++ b/lightning/src/ln/onion_payment.rs @@ -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 { -- 2.39.5