File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -667,15 +667,21 @@ where
667
667
. and_then ( |o| o. status . confirmation_height ( ) ) ;
668
668
669
669
// Unconfirm all >= this height.
670
+ let mut should_persist = false ;
670
671
state_lock
671
672
. outputs
672
673
. iter_mut ( )
673
674
. filter ( |o| o. status . confirmation_height ( ) >= unconf_height)
674
- . for_each ( |o| o. status . unconfirmed ( ) ) ;
675
+ . for_each ( |o| {
676
+ should_persist = true ;
677
+ o. status . unconfirmed ( )
678
+ } ) ;
675
679
676
- self . persist_state ( & * state_lock) . unwrap_or_else ( |e| {
677
- log_error ! ( self . logger, "Error persisting OutputSweeper: {:?}" , e) ;
678
- } ) ;
680
+ if should_persist {
681
+ self . persist_state ( & * state_lock) . unwrap_or_else ( |e| {
682
+ log_error ! ( self . logger, "Error persisting OutputSweeper: {:?}" , e) ;
683
+ } ) ;
684
+ }
679
685
}
680
686
681
687
fn best_block_updated ( & self , header : & Header , height : u32 ) {
You can’t perform that action at this time.
0 commit comments