From 246d33d99b346eb0026963d9af9cbae43806c7df Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Wed, 9 Nov 2022 14:19:56 -0500 Subject: [PATCH] Rename PendingHTLCInfo fields to include msat suffix --- lightning/src/ln/channelmanager.rs | 42 +++++++++++++-------------- lightning/src/ln/onion_route_tests.rs | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 7f9531331..700f0ec81 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -112,8 +112,8 @@ pub(super) struct PendingHTLCInfo { pub(super) routing: PendingHTLCRouting, pub(super) incoming_shared_secret: [u8; 32], payment_hash: PaymentHash, - pub(super) amt_to_forward: u64, - pub(super) amt_incoming: Option, // Added in 0.0.113 + pub(super) incoming_amt_msat: Option, // Added in 0.0.113 + pub(super) outgoing_amt_msat: u64, pub(super) outgoing_cltv_value: u32, } @@ -2197,8 +2197,8 @@ impl ChannelManager ChannelManager ChannelManager ChannelManager { macro_rules! failure_handler { @@ -3220,7 +3220,7 @@ impl ChannelManager { - match self.construct_recv_pending_htlc_info(hop_data, incoming_shared_secret, payment_hash, amt_to_forward, outgoing_cltv_value, Some(phantom_shared_secret)) { + match self.construct_recv_pending_htlc_info(hop_data, incoming_shared_secret, payment_hash, outgoing_amt_msat, outgoing_cltv_value, Some(phantom_shared_secret)) { Ok(info) => phantom_receives.push((prev_short_channel_id, prev_funding_outpoint, vec![(info, prev_htlc_id)])), Err(ReceiveError { err_code, err_data, msg }) => failed_payment!(msg, err_code, err_data, Some(phantom_shared_secret)) } @@ -3264,8 +3264,8 @@ impl ChannelManager { log_trace!(self.logger, "Adding HTLC from short id {} with payment_hash {} to channel with short id {} after delay", prev_short_channel_id, log_bytes!(payment_hash.0), short_chan_id); @@ -3277,7 +3277,7 @@ impl ChannelManager { if let ChannelError::Ignore(msg) = e { log_trace!(self.logger, "Failed to forward HTLC with payment_hash {}: {}", log_bytes!(payment_hash.0), msg); @@ -3391,7 +3391,7 @@ impl ChannelManager { let (cltv_expiry, onion_payload, payment_data, phantom_shared_secret) = match routing { @@ -3413,9 +3413,9 @@ impl ChannelManager ChannelManager - forward_info.amt_to_forward -= 1, + forward_info.outgoing_amt_msat -= 1, _ => {}, } } -- 2.39.5