File tree Expand file tree Collapse file tree
miner-apps/translator/src/lib/sv2/channel_manager Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,9 +310,13 @@ impl HandleMiningMessagesFromServerAsync for ChannelManager {
310310 return Err ( TproxyError :: fallback (
311311 TproxyErrorKind :: AggregatedChannelClosed ,
312312 ) ) ;
313+ }
314+
315+ let group_channel = self . group_channels . remove ( & m. channel_id ) ;
316+
313317 // we're not in aggregated mode
314318 // was the message sent to a group channel?
315- } else if let Some ( group_channel_arc) = self . group_channels . get ( & m . channel_id ) {
319+ if let Some ( ( _ , group_channel_arc) ) = group_channel {
316320 let group_channel = group_channel_arc. read ( ) . map_err ( |e| {
317321 error ! ( "Failed to read group channel: {:?}" , e) ;
318322 TproxyError :: shutdown ( TproxyErrorKind :: PoisonLock )
@@ -321,9 +325,6 @@ impl HandleMiningMessagesFromServerAsync for ChannelManager {
321325 for channel_id in group_channel. get_channel_ids ( ) {
322326 self . extended_channels . remove ( channel_id) ;
323327 }
324-
325- drop ( group_channel) ;
326- self . group_channels . remove ( & m. channel_id ) ;
327328 // if the message was not sent to a group channel, and we're not working in
328329 // aggregated mode,
329330 } else if self . extended_channels . contains_key ( & m. channel_id ) {
@@ -347,6 +348,7 @@ impl HandleMiningMessagesFromServerAsync for ChannelManager {
347348 ) ;
348349 return Err ( TproxyError :: log ( TproxyErrorKind :: ChannelNotFound ) ) ;
349350 }
351+
350352 Ok ( ( ) )
351353 }
352354
You can’t perform that action at this time.
0 commit comments