Skip to content

Commit 7b538e2

Browse files
committed
f rename new map
1 parent 6bfb3ad commit 7b538e2

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
452452
/// after reloading from disk while replaying blocks against ChannelMonitors.
453453
///
454454
/// Locked *after* channel_state.
455-
outbound_pending_payments: Mutex<HashSet<[u8; 32]>>,
455+
pending_outbound_payments: Mutex<HashSet<[u8; 32]>>,
456456

457457
our_network_key: SecretKey,
458458
our_network_pubkey: PublicKey,
@@ -925,7 +925,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
925925
pending_msg_events: Vec::new(),
926926
}),
927927
pending_inbound_payments: Mutex::new(HashMap::new()),
928-
outbound_pending_payments: Mutex::new(HashSet::new()),
928+
pending_outbound_payments: Mutex::new(HashSet::new()),
929929

930930
our_network_key: keys_manager.get_node_secret(),
931931
our_network_pubkey: PublicKey::from_secret_key(&secp_ctx, &keys_manager.get_node_secret()),
@@ -1492,7 +1492,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
14921492
let onion_packet = onion_utils::construct_onion_packet(onion_payloads, onion_keys, prng_seed, payment_hash);
14931493

14941494
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(&self.total_consistency_lock, &self.persistence_notifier);
1495-
assert!(self.outbound_pending_payments.lock().unwrap().insert(session_priv_bytes));
1495+
assert!(self.pending_outbound_payments.lock().unwrap().insert(session_priv_bytes));
14961496

14971497
let err: Result<(), _> = loop {
14981498
let mut channel_lock = self.channel_state.lock().unwrap();
@@ -2247,7 +2247,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
22472247
if {
22482248
let mut session_priv_bytes = [0; 32];
22492249
session_priv_bytes.copy_from_slice(&session_priv[..]);
2250-
self.outbound_pending_payments.lock().unwrap().remove(&session_priv_bytes)
2250+
self.pending_outbound_payments.lock().unwrap().remove(&session_priv_bytes)
22512251
} {
22522252
self.pending_events.lock().unwrap().push(
22532253
events::Event::PaymentFailed {
@@ -2285,7 +2285,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
22852285
if {
22862286
let mut session_priv_bytes = [0; 32];
22872287
session_priv_bytes.copy_from_slice(&session_priv[..]);
2288-
!self.outbound_pending_payments.lock().unwrap().remove(&session_priv_bytes)
2288+
!self.pending_outbound_payments.lock().unwrap().remove(&session_priv_bytes)
22892289
} {
22902290
return;
22912291
}
@@ -2522,7 +2522,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
25222522
if {
25232523
let mut session_priv_bytes = [0; 32];
25242524
session_priv_bytes.copy_from_slice(&session_priv[..]);
2525-
self.outbound_pending_payments.lock().unwrap().remove(&session_priv_bytes)
2525+
self.pending_outbound_payments.lock().unwrap().remove(&session_priv_bytes)
25262526
} {
25272527
let mut pending_events = self.pending_events.lock().unwrap();
25282528
pending_events.push(events::Event::PaymentSent {
@@ -4504,9 +4504,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable f
45044504
pending_payment.write(writer)?;
45054505
}
45064506

4507-
let outbound_pending_payments = self.outbound_pending_payments.lock().unwrap();
4508-
(outbound_pending_payments.len() as u64).write(writer)?;
4509-
for session_priv in outbound_pending_payments.iter() {
4507+
let pending_outbound_payments = self.pending_outbound_payments.lock().unwrap();
4508+
(pending_outbound_payments.len() as u64).write(writer)?;
4509+
for session_priv in pending_outbound_payments.iter() {
45104510
session_priv.write(writer)?;
45114511
}
45124512

@@ -4749,10 +4749,10 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
47494749
}
47504750
}
47514751

4752-
let outbound_pending_payments_count: u64 = Readable::read(reader)?;
4753-
let mut outbound_pending_payments: HashSet<[u8; 32]> = HashSet::with_capacity(cmp::min(outbound_pending_payments_count as usize, MAX_ALLOC_SIZE/32));
4754-
for _ in 0..outbound_pending_payments_count {
4755-
if !outbound_pending_payments.insert(Readable::read(reader)?) {
4752+
let pending_outbound_payments_count: u64 = Readable::read(reader)?;
4753+
let mut pending_outbound_payments: HashSet<[u8; 32]> = HashSet::with_capacity(cmp::min(pending_outbound_payments_count as usize, MAX_ALLOC_SIZE/32));
4754+
for _ in 0..pending_outbound_payments_count {
4755+
if !pending_outbound_payments.insert(Readable::read(reader)?) {
47564756
return Err(DecodeError::InvalidValue);
47574757
}
47584758
}
@@ -4776,7 +4776,7 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
47764776
pending_msg_events: Vec::new(),
47774777
}),
47784778
pending_inbound_payments: Mutex::new(pending_inbound_payments),
4779-
outbound_pending_payments: Mutex::new(outbound_pending_payments),
4779+
pending_outbound_payments: Mutex::new(pending_outbound_payments),
47804780

47814781
our_network_key: args.keys_manager.get_node_secret(),
47824782
our_network_pubkey: PublicKey::from_secret_key(&secp_ctx, &args.keys_manager.get_node_secret()),

0 commit comments

Comments
 (0)