@@ -3931,12 +3931,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
3931
3931
}
3932
3932
3933
3933
fn finalize_claims ( & self , mut sources : Vec < HTLCSource > ) {
3934
+ let mut outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
3934
3935
let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
3935
3936
for source in sources. drain ( ..) {
3936
3937
if let HTLCSource :: OutboundRoute { session_priv, payment_id, path, .. } = source {
3937
3938
let mut session_priv_bytes = [ 0 ; 32 ] ;
3938
3939
session_priv_bytes. copy_from_slice ( & session_priv[ ..] ) ;
3939
- let mut outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
3940
3940
if let hash_map:: Entry :: Occupied ( mut payment) = outbounds. entry ( payment_id) {
3941
3941
assert ! ( payment. get( ) . is_fulfilled( ) ) ;
3942
3942
if payment. get_mut ( ) . remove ( & session_priv_bytes, None ) {
@@ -5321,8 +5321,8 @@ where
5321
5321
inbound_payment. expiry_time > header. time as u64
5322
5322
} ) ;
5323
5323
5324
- let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
5325
5324
let mut outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
5325
+ let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
5326
5326
outbounds. retain ( |payment_id, payment| {
5327
5327
if payment. remaining_parts ( ) != 0 { return true }
5328
5328
if let PendingOutboundPayment :: Retryable { starting_block_height, payment_hash, .. } = payment {
@@ -6151,6 +6151,8 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable f
6151
6151
peer_state. latest_features . write ( writer) ?;
6152
6152
}
6153
6153
6154
+ let pending_inbound_payments = self . pending_inbound_payments . lock ( ) . unwrap ( ) ;
6155
+ let pending_outbound_payments = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
6154
6156
let events = self . pending_events . lock ( ) . unwrap ( ) ;
6155
6157
( events. len ( ) as u64 ) . write ( writer) ?;
6156
6158
for event in events. iter ( ) {
@@ -6172,14 +6174,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable f
6172
6174
( self . last_node_announcement_serial . load ( Ordering :: Acquire ) as u32 ) . write ( writer) ?;
6173
6175
( self . highest_seen_timestamp . load ( Ordering :: Acquire ) as u32 ) . write ( writer) ?;
6174
6176
6175
- let pending_inbound_payments = self . pending_inbound_payments . lock ( ) . unwrap ( ) ;
6176
6177
( pending_inbound_payments. len ( ) as u64 ) . write ( writer) ?;
6177
6178
for ( hash, pending_payment) in pending_inbound_payments. iter ( ) {
6178
6179
hash. write ( writer) ?;
6179
6180
pending_payment. write ( writer) ?;
6180
6181
}
6181
6182
6182
- let pending_outbound_payments = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
6183
6183
// For backwards compat, write the session privs and their total length.
6184
6184
let mut num_pending_outbounds_compat: u64 = 0 ;
6185
6185
for ( _, outbound) in pending_outbound_payments. iter ( ) {
0 commit comments