From ca3193449583ba7cf8323a914c1264d3a19daeea Mon Sep 17 00:00:00 2001 From: Anton Yemelyanov Date: Wed, 13 Sep 2023 21:07:09 +0300 Subject: [PATCH] UtxoProcessor - ignore task shutdown if not running --- wallet/core/src/utxo/processor.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wallet/core/src/utxo/processor.rs b/wallet/core/src/utxo/processor.rs index 79173225b..52daac29b 100644 --- a/wallet/core/src/utxo/processor.rs +++ b/wallet/core/src/utxo/processor.rs @@ -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(()) } }