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 @@ -644,23 +644,17 @@ impl ChannelManager {
644644 // Update the local upstream channel's nominal hashrate so
645645 // that monitoring reports a value consistent with the
646646 // downstream vardiff estimate.
647- self . channel_manager_data . super_safe_lock ( |c| {
648- if let Some ( ref upstream_channel) = c. upstream_extended_channel {
649- if let Ok ( mut ch) = upstream_channel. write ( ) {
650- ch. set_nominal_hashrate ( m. nominal_hash_rate ) ;
651- m. channel_id = ch. get_channel_id ( ) ;
652- }
647+ self . upstream_extended_channel . super_safe_lock ( |channel| {
648+ if let Some ( ref mut upstream_channel) = channel {
649+ upstream_channel. set_nominal_hashrate ( m. nominal_hash_rate ) ;
650+ m. channel_id = upstream_channel. get_channel_id ( ) ;
653651 }
654652 } ) ;
655653 } else {
656654 // Non-aggregated: update the specific channel's nominal hashrate
657- self . channel_manager_data . super_safe_lock ( |c| {
658- if let Some ( channel) = c. extended_channels . get ( & m. channel_id ) {
659- if let Ok ( mut ch) = channel. write ( ) {
660- ch. set_nominal_hashrate ( m. nominal_hash_rate ) ;
661- }
662- }
663- } ) ;
655+ if let Some ( ref mut channel) = self . extended_channels . get_mut ( & m. channel_id ) {
656+ channel. set_nominal_hashrate ( m. nominal_hash_rate ) ;
657+ }
664658 }
665659
666660 info ! (
You can’t perform that action at this time.
0 commit comments