File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -662,18 +662,14 @@ where
662
662
. find ( |o| o. status . latest_spending_tx ( ) . map ( |tx| tx. txid ( ) ) == Some ( * txid) )
663
663
. and_then ( |o| o. status . confirmation_height ( ) ) ;
664
664
665
- // Unconfirm all >= this height.
666
- let mut should_persist = false ;
667
- state_lock
668
- . outputs
669
- . iter_mut ( )
670
- . filter ( |o| o. status . confirmation_height ( ) >= unconf_height)
671
- . for_each ( |o| {
672
- should_persist = true ;
673
- o. status . unconfirmed ( )
674
- } ) ;
665
+ if let Some ( unconf_height) = unconf_height {
666
+ // Unconfirm all >= this height.
667
+ state_lock
668
+ . outputs
669
+ . iter_mut ( )
670
+ . filter ( |o| o. status . confirmation_height ( ) >= Some ( unconf_height) )
671
+ . for_each ( |o| o. status . unconfirmed ( ) ) ;
675
672
676
- if should_persist {
677
673
self . persist_state ( & * state_lock) . unwrap_or_else ( |e| {
678
674
log_error ! ( self . logger, "Error persisting OutputSweeper: {:?}" , e) ;
679
675
} ) ;
You can’t perform that action at this time.
0 commit comments