@@ -2259,8 +2259,8 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2259
2259
// short_channel_id is non-0 in any ::Forward.
2260
2260
if let & PendingHTLCRouting :: Forward { ref short_channel_id, .. } = routing {
2261
2261
if let Some ( ( err, code, chan_update) ) = loop {
2262
- let mut channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
2263
2262
let id_option = self . short_to_chan_info . read ( ) . unwrap ( ) . get ( & short_channel_id) . cloned ( ) ;
2263
+ let mut channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
2264
2264
let forwarding_id_opt = match id_option {
2265
2265
None => { // unknown_next_peer
2266
2266
// Note that this is likely a timing oracle for detecting whether an scid is a
@@ -2447,13 +2447,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2447
2447
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
2448
2448
2449
2449
let err: Result < ( ) , _ > = loop {
2450
- let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
2451
-
2452
2450
let id = match self . short_to_chan_info . read ( ) . unwrap ( ) . get ( & path. first ( ) . unwrap ( ) . short_channel_id ) {
2453
2451
None => return Err ( APIError :: ChannelUnavailable { err : "No channel available with first hop!" . to_owned ( ) } ) ,
2454
2452
Some ( ( _cp_id, chan_id) ) => chan_id. clone ( ) ,
2455
2453
} ;
2456
2454
2455
+ let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
2457
2456
let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
2458
2457
let payment_entry = pending_outbounds. entry ( payment_id) ;
2459
2458
if let hash_map:: Entry :: Occupied ( payment) = & payment_entry {
0 commit comments