@@ -674,19 +674,19 @@ pub type SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, M, T, F, L> = ChannelManage
674
674
// |
675
675
// |__`forward_htlcs`
676
676
// |
677
- // |__`channel_state `
677
+ // |__`pending_inbound_payments `
678
678
// | |
679
- // | |__`id_to_peer `
679
+ // | |__`claimable_htlcs `
680
680
// | |
681
- // | |__`per_peer_state `
681
+ // | |__`pending_outbound_payments `
682
682
// | |
683
- // | |__`outbound_scid_aliases`
684
- // | |
685
- // | |__`pending_inbound_payments`
683
+ // | |__`channel_state`
686
684
// | |
687
- // | |__`claimable_htlcs `
685
+ // | |__`id_to_peer `
688
686
// | |
689
- // | |__`pending_outbound_payments`
687
+ // | |__`per_peer_state`
688
+ // | |
689
+ // | |__`outbound_scid_aliases`
690
690
// | |
691
691
// | |__`best_block`
692
692
// | |
@@ -2474,9 +2474,9 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
2474
2474
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
2475
2475
2476
2476
let err: Result < ( ) , _ > = loop {
2477
+ let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
2477
2478
let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
2478
2479
2479
- let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
2480
2480
let payment_entry = pending_outbounds. entry ( payment_id) ;
2481
2481
if let hash_map:: Entry :: Occupied ( payment) = & payment_entry {
2482
2482
if !payment. get ( ) . is_retryable ( ) {
@@ -6666,18 +6666,19 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable for ChannelMana
6666
6666
}
6667
6667
}
6668
6668
6669
- let mut htlc_purposes : Vec < events :: PaymentPurpose > = Vec :: new ( ) ;
6670
- {
6671
- let claimable_htlcs = self . claimable_htlcs . lock ( ) . unwrap ( ) ;
6672
- ( claimable_htlcs . len ( ) as u64 ) . write ( writer ) ? ;
6673
- for ( payment_hash , ( purpose , previous_hops ) ) in claimable_htlcs . iter ( ) {
6674
- payment_hash . write ( writer) ?;
6675
- ( previous_hops . len ( ) as u64 ) . write ( writer ) ? ;
6676
- for htlc in previous_hops . iter ( ) {
6677
- htlc . write ( writer) ?;
6678
- }
6679
- htlc_purposes . push ( purpose . clone ( ) ) ;
6669
+ let pending_inbound_payments = self . pending_inbound_payments . lock ( ) . unwrap ( ) ;
6670
+ let claimable_htlcs = self . claimable_htlcs . lock ( ) . unwrap ( ) ;
6671
+ let pending_outbound_payments = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
6672
+
6673
+ let mut htlc_purposes : Vec < & events :: PaymentPurpose > = Vec :: new ( ) ;
6674
+ ( claimable_htlcs . len ( ) as u64 ) . write ( writer) ?;
6675
+ for ( payment_hash , ( purpose , previous_hops ) ) in claimable_htlcs . iter ( ) {
6676
+ payment_hash . write ( writer ) ? ;
6677
+ ( previous_hops . len ( ) as u64 ) . write ( writer) ?;
6678
+ for htlc in previous_hops . iter ( ) {
6679
+ htlc . write ( writer ) ? ;
6680
6680
}
6681
+ htlc_purposes. push ( purpose) ;
6681
6682
}
6682
6683
6683
6684
let per_peer_state = self . per_peer_state . write ( ) . unwrap ( ) ;
@@ -6688,8 +6689,6 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable for ChannelMana
6688
6689
peer_state. latest_features . write ( writer) ?;
6689
6690
}
6690
6691
6691
- let pending_inbound_payments = self . pending_inbound_payments . lock ( ) . unwrap ( ) ;
6692
- let pending_outbound_payments = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
6693
6692
let events = self . pending_events . lock ( ) . unwrap ( ) ;
6694
6693
( events. len ( ) as u64 ) . write ( writer) ?;
6695
6694
for event in events. iter ( ) {
0 commit comments