Skip to content

Commit a201e82

Browse files
committed
f rename field
1 parent d12c568 commit a201e82

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ struct ClaimablePayments {
485485
///
486486
/// When adding to the map, [`Self::pending_claiming_payments`] must also be checked to ensure
487487
/// we don't get a duplicate payment.
488-
claimable_htlcs: HashMap<PaymentHash, ClaimablePayment>,
488+
claimable_payments: HashMap<PaymentHash, ClaimablePayment>,
489489

490490
/// Map from payment hash to the payment data for HTLCs which we have begun claiming, but which
491491
/// are waiting on a [`ChannelMonitorUpdate`] to complete in order to be surfaced to the user
@@ -1673,7 +1673,7 @@ where
16731673
pending_inbound_payments: Mutex::new(HashMap::new()),
16741674
pending_outbound_payments: OutboundPayments::new(),
16751675
forward_htlcs: Mutex::new(HashMap::new()),
1676-
claimable_payments: Mutex::new(ClaimablePayments { claimable_htlcs: HashMap::new(), pending_claiming_payments: HashMap::new() }),
1676+
claimable_payments: Mutex::new(ClaimablePayments { claimable_payments: HashMap::new(), pending_claiming_payments: HashMap::new() }),
16771677
pending_intercepted_htlcs: Mutex::new(HashMap::new()),
16781678
id_to_peer: Mutex::new(HashMap::new()),
16791679
short_to_chan_info: FairRwLock::new(HashMap::new()),
@@ -3354,7 +3354,7 @@ where
33543354
fail_htlc!(claimable_htlc, payment_hash);
33553355
continue
33563356
}
3357-
let ref mut claimable_payment = claimable_payments.claimable_htlcs
3357+
let ref mut claimable_payment = claimable_payments.claimable_payments
33583358
.entry(payment_hash)
33593359
// Note that if we insert here we MUST NOT fail_htlc!()
33603360
.or_insert_with(|| ClaimablePayment {
@@ -3455,7 +3455,7 @@ where
34553455
fail_htlc!(claimable_htlc, payment_hash);
34563456
continue
34573457
}
3458-
match claimable_payments.claimable_htlcs.entry(payment_hash) {
3458+
match claimable_payments.claimable_payments.entry(payment_hash) {
34593459
hash_map::Entry::Vacant(e) => {
34603460
let amount_msat = claimable_htlc.value;
34613461
claimable_htlc.total_value_received = Some(amount_msat);
@@ -3721,7 +3721,7 @@ where
37213721
}
37223722
}
37233723

3724-
self.claimable_payments.lock().unwrap().claimable_htlcs.retain(|payment_hash, payment| {
3724+
self.claimable_payments.lock().unwrap().claimable_payments.retain(|payment_hash, payment| {
37253725
if payment.htlcs.is_empty() {
37263726
// This should be unreachable
37273727
debug_assert!(false);
@@ -3796,7 +3796,7 @@ where
37963796
pub fn fail_htlc_backwards_with_reason(&self, payment_hash: &PaymentHash, failure_code: FailureCode) {
37973797
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(&self.total_consistency_lock, &self.persistence_notifier);
37983798

3799-
let removed_source = self.claimable_payments.lock().unwrap().claimable_htlcs.remove(payment_hash);
3799+
let removed_source = self.claimable_payments.lock().unwrap().claimable_payments.remove(payment_hash);
38003800
if let Some(payment) = removed_source {
38013801
for htlc in payment.htlcs {
38023802
let reason = self.get_htlc_fail_reason_from_failure_code(failure_code, &htlc);
@@ -3975,7 +3975,7 @@ where
39753975

39763976
let mut sources = {
39773977
let mut claimable_payments = self.claimable_payments.lock().unwrap();
3978-
if let Some(payment) = claimable_payments.claimable_htlcs.remove(&payment_hash) {
3978+
if let Some(payment) = claimable_payments.claimable_payments.remove(&payment_hash) {
39793979
let mut receiver_node_id = self.our_network_pubkey;
39803980
for htlc in payment.htlcs.iter() {
39813981
if htlc.prev_hop.phantom_shared_secret.is_some() {
@@ -6107,7 +6107,7 @@ where
61076107
}
61086108

61096109
if let Some(height) = height_opt {
6110-
self.claimable_payments.lock().unwrap().claimable_htlcs.retain(|payment_hash, payment| {
6110+
self.claimable_payments.lock().unwrap().claimable_payments.retain(|payment_hash, payment| {
61116111
payment.htlcs.retain(|htlc| {
61126112
// If height is approaching the number of blocks we think it takes us to get
61136113
// our commitment transaction confirmed before the HTLC expires, plus the
@@ -7044,8 +7044,8 @@ where
70447044
let pending_outbound_payments = self.pending_outbound_payments.pending_outbound_payments.lock().unwrap();
70457045

70467046
let mut htlc_purposes: Vec<&events::PaymentPurpose> = Vec::new();
7047-
(claimable_payments.claimable_htlcs.len() as u64).write(writer)?;
7048-
for (payment_hash, payment) in claimable_payments.claimable_htlcs.iter() {
7047+
(claimable_payments.claimable_payments.len() as u64).write(writer)?;
7048+
for (payment_hash, payment) in claimable_payments.claimable_payments.iter() {
70497049
payment_hash.write(writer)?;
70507050
(payment.htlcs.len() as u64).write(writer)?;
70517051
for htlc in payment.htlcs.iter() {
@@ -7704,13 +7704,13 @@ where
77047704
let inbound_pmt_key_material = args.node_signer.get_inbound_payment_key_material();
77057705
let expanded_inbound_key = inbound_payment::ExpandedKey::new(&inbound_pmt_key_material);
77067706

7707-
let mut claimable_htlcs = HashMap::with_capacity(claimable_htlcs_list.len());
7707+
let mut claimable_payments = HashMap::with_capacity(claimable_htlcs_list.len());
77087708
if let Some(mut purposes) = claimable_htlc_purposes {
77097709
if purposes.len() != claimable_htlcs_list.len() {
77107710
return Err(DecodeError::InvalidValue);
77117711
}
77127712
for (purpose, (payment_hash, htlcs)) in purposes.drain(..).zip(claimable_htlcs_list.drain(..)) {
7713-
let existing_payment = claimable_htlcs.insert(payment_hash, ClaimablePayment {
7713+
let existing_payment = claimable_payments.insert(payment_hash, ClaimablePayment {
77147714
purpose, htlcs,
77157715
});
77167716
if existing_payment.is_some() { return Err(DecodeError::InvalidValue); }
@@ -7743,7 +7743,7 @@ where
77437743
OnionPayload::Spontaneous(payment_preimage) =>
77447744
events::PaymentPurpose::SpontaneousPayment(*payment_preimage),
77457745
};
7746-
claimable_htlcs.insert(payment_hash, ClaimablePayment {
7746+
claimable_payments.insert(payment_hash, ClaimablePayment {
77477747
purpose, htlcs,
77487748
});
77497749
}
@@ -7797,7 +7797,7 @@ where
77977797

77987798
for (_, monitor) in args.channel_monitors.iter() {
77997799
for (payment_hash, payment_preimage) in monitor.get_stored_preimages() {
7800-
if let Some(payment) = claimable_htlcs.remove(&payment_hash) {
7800+
if let Some(payment) = claimable_payments.remove(&payment_hash) {
78017801
log_info!(args.logger, "Re-claiming HTLCs with payment hash {} as we've released the preimage to a ChannelMonitor!", log_bytes!(payment_hash.0));
78027802
let mut claimable_amt_msat = 0;
78037803
let mut receiver_node_id = Some(our_network_pubkey);
@@ -7872,7 +7872,7 @@ where
78727872
pending_intercepted_htlcs: Mutex::new(pending_intercepted_htlcs.unwrap()),
78737873

78747874
forward_htlcs: Mutex::new(forward_htlcs),
7875-
claimable_payments: Mutex::new(ClaimablePayments { claimable_htlcs, pending_claiming_payments: pending_claiming_payments.unwrap() }),
7875+
claimable_payments: Mutex::new(ClaimablePayments { claimable_payments, pending_claiming_payments: pending_claiming_payments.unwrap() }),
78767876
outbound_scid_aliases: Mutex::new(outbound_scid_aliases),
78777877
id_to_peer: Mutex::new(id_to_peer),
78787878
short_to_chan_info: FairRwLock::new(short_to_chan_info),

0 commit comments

Comments
 (0)