@@ -2241,13 +2241,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2241
2241
}
2242
2242
} ;
2243
2243
2244
- let mut channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
2245
2244
if let & PendingHTLCStatus :: Forward ( PendingHTLCInfo { ref routing, ref amt_to_forward, ref outgoing_cltv_value, .. } ) = & pending_forward_info {
2246
2245
// If short_channel_id is 0 here, we'll reject the HTLC as there cannot be a channel
2247
2246
// with a short_channel_id of 0. This is important as various things later assume
2248
2247
// short_channel_id is non-0 in any ::Forward.
2249
2248
if let & PendingHTLCRouting :: Forward { ref short_channel_id, .. } = routing {
2250
- let id_option = channel_state. short_to_chan_info . get ( & short_channel_id) . cloned ( ) ;
2249
+ let id_option = self . channel_state . lock ( ) . unwrap ( ) . short_to_chan_info . get ( & short_channel_id) . cloned ( ) ;
2251
2250
if let Some ( ( err, code, chan_update) ) = loop {
2252
2251
let forwarding_id_opt = match id_option {
2253
2252
None => { // unknown_next_peer
@@ -2262,6 +2261,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2262
2261
Some ( ( _cp_id, chan_id) ) => Some ( chan_id. clone ( ) ) ,
2263
2262
} ;
2264
2263
let chan_update_opt = if let Some ( forwarding_id) = forwarding_id_opt {
2264
+ let mut channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
2265
2265
let chan = channel_state. by_id . get_mut ( & forwarding_id) . unwrap ( ) ;
2266
2266
if !chan. should_announce ( ) && !self . default_configuration . accept_forwards_to_priv_channels {
2267
2267
// Note that the behavior here should be identical to the above block - we
0 commit comments