@@ -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
// | |
@@ -2455,8 +2455,6 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2455
2455
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
2456
2456
2457
2457
let err: Result < ( ) , _ > = loop {
2458
- let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
2459
-
2460
2458
let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
2461
2459
let payment_entry = pending_outbounds. entry ( payment_id) ;
2462
2460
if let hash_map:: Entry :: Occupied ( payment) = & payment_entry {
@@ -2467,6 +2465,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2467
2465
}
2468
2466
}
2469
2467
2468
+ let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
2470
2469
let id = match channel_lock. short_to_chan_info . get ( & path. first ( ) . unwrap ( ) . short_channel_id ) {
2471
2470
None => return Err ( APIError :: ChannelUnavailable { err : "No channel available with first hop!" . to_owned ( ) } ) ,
2472
2471
Some ( ( _cp_id, chan_id) ) => chan_id. clone ( ) ,
@@ -6641,18 +6640,19 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable f
6641
6640
}
6642
6641
}
6643
6642
6644
- let mut htlc_purposes : Vec < events :: PaymentPurpose > = Vec :: new ( ) ;
6645
- {
6646
- let claimable_htlcs = self . claimable_htlcs . lock ( ) . unwrap ( ) ;
6647
- ( claimable_htlcs . len ( ) as u64 ) . write ( writer ) ? ;
6648
- for ( payment_hash , ( purpose , previous_hops ) ) in claimable_htlcs . iter ( ) {
6649
- payment_hash . write ( writer) ?;
6650
- ( previous_hops . len ( ) as u64 ) . write ( writer ) ? ;
6651
- for htlc in previous_hops . iter ( ) {
6652
- htlc . write ( writer) ?;
6653
- }
6654
- htlc_purposes . push ( purpose . clone ( ) ) ;
6643
+ let pending_inbound_payments = self . pending_inbound_payments . lock ( ) . unwrap ( ) ;
6644
+ let claimable_htlcs = self . claimable_htlcs . lock ( ) . unwrap ( ) ;
6645
+ let pending_outbound_payments = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
6646
+
6647
+ let mut htlc_purposes : Vec < & events :: PaymentPurpose > = Vec :: new ( ) ;
6648
+ ( claimable_htlcs . len ( ) as u64 ) . write ( writer) ?;
6649
+ for ( payment_hash , ( purpose , previous_hops ) ) in claimable_htlcs . iter ( ) {
6650
+ payment_hash . write ( writer ) ? ;
6651
+ ( previous_hops . len ( ) as u64 ) . write ( writer) ?;
6652
+ for htlc in previous_hops . iter ( ) {
6653
+ htlc . write ( writer ) ? ;
6655
6654
}
6655
+ htlc_purposes. push ( purpose) ;
6656
6656
}
6657
6657
6658
6658
let per_peer_state = self . per_peer_state . write ( ) . unwrap ( ) ;
@@ -6663,8 +6663,6 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable f
6663
6663
peer_state. latest_features . write ( writer) ?;
6664
6664
}
6665
6665
6666
- let pending_inbound_payments = self . pending_inbound_payments . lock ( ) . unwrap ( ) ;
6667
- let pending_outbound_payments = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
6668
6666
let events = self . pending_events . lock ( ) . unwrap ( ) ;
6669
6667
( events. len ( ) as u64 ) . write ( writer) ?;
6670
6668
for event in events. iter ( ) {
0 commit comments