Skip to content

Commit

Permalink
UtxoProcessor - ignore task shutdown if not running
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Sep 13, 2023
1 parent 2427a48 commit ca31934
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wallet/core/src/utxo/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ impl UtxoProcessor {
}

pub async fn stop(&self) -> Result<()> {
self.inner.sync_proc.stop().await?;
self.inner.task_ctl.signal(()).await.expect("UtxoProcessor::stop_task() `signal` error");
if self.inner.task_is_running.load(Ordering::SeqCst) {
self.inner.sync_proc.stop().await?;
self.inner.task_ctl.signal(()).await.expect("UtxoProcessor::stop_task() `signal` error");
}
Ok(())
}
}

0 comments on commit ca31934

Please sign in to comment.