Skip to content

Commit 2b1c994

Browse files
Rename InboundOnionPayload::BlindedReceive::amt_msat to be more descriptive.
1 parent 2d58297 commit 2b1c994

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lightning/src/ln/msgs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ mod fuzzy_internal_msgs {
17171717
intro_node_blinding_point: PublicKey,
17181718
},
17191719
BlindedReceive {
1720-
amt_msat: u64,
1720+
sender_intended_htlc_amt_msat: u64,
17211721
total_msat: u64,
17221722
cltv_expiry_height: u32,
17231723
payment_secret: PaymentSecret,
@@ -2400,7 +2400,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
24002400
})} => {
24012401
if total_msat.unwrap_or(0) > MAX_VALUE_MSAT { return Err(DecodeError::InvalidValue) }
24022402
Ok(Self::BlindedReceive {
2403-
amt_msat: amt.ok_or(DecodeError::InvalidValue)?,
2403+
sender_intended_htlc_amt_msat: amt.ok_or(DecodeError::InvalidValue)?,
24042404
total_msat: total_msat.ok_or(DecodeError::InvalidValue)?,
24052405
cltv_expiry_height: cltv_value.ok_or(DecodeError::InvalidValue)?,
24062406
payment_secret,

lightning/src/ln/onion_payment.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,12 @@ pub(super) fn create_recv_pending_htlc_info(
132132
(payment_data, keysend_preimage, custom_tlvs, sender_intended_htlc_amt_msat,
133133
cltv_expiry_height, payment_metadata, false),
134134
msgs::InboundOnionPayload::BlindedReceive {
135-
amt_msat, total_msat, cltv_expiry_height, payment_secret, intro_node_blinding_point,
136-
payment_constraints, ..
135+
sender_intended_htlc_amt_msat, total_msat, cltv_expiry_height, payment_secret,
136+
intro_node_blinding_point, payment_constraints, ..
137137
} => {
138-
check_blinded_payment_constraints(amt_msat, cltv_expiry, &payment_constraints)
138+
check_blinded_payment_constraints(
139+
sender_intended_htlc_amt_msat, cltv_expiry, &payment_constraints
140+
)
139141
.map_err(|()| {
140142
InboundHTLCErr {
141143
err_code: INVALID_ONION_BLINDING,
@@ -144,8 +146,8 @@ pub(super) fn create_recv_pending_htlc_info(
144146
}
145147
})?;
146148
let payment_data = msgs::FinalOnionHopData { payment_secret, total_msat };
147-
(Some(payment_data), None, Vec::new(), amt_msat, cltv_expiry_height, None,
148-
intro_node_blinding_point.is_none())
149+
(Some(payment_data), None, Vec::new(), sender_intended_htlc_amt_msat, cltv_expiry_height,
150+
None, intro_node_blinding_point.is_none())
149151
}
150152
msgs::InboundOnionPayload::Forward { .. } => {
151153
return Err(InboundHTLCErr {

0 commit comments

Comments
 (0)