From 0765cb8e301a2e0feb1c7e4b0553e7dd511a718a Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sat, 18 May 2024 10:57:02 +0300 Subject: [PATCH] wallet: cancel tx on wallet sync finish --- src/wallet/wallet.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wallet/wallet.rs b/src/wallet/wallet.rs index c8bd8c7c..d362608f 100644 --- a/src/wallet/wallet.rs +++ b/src/wallet/wallet.rs @@ -914,6 +914,10 @@ impl Wallet { let wallet = self.clone(); thread::spawn(move || { + // Wait sync to finish. + if wallet.syncing() { + thread::sleep(Duration::from_millis(1000)); + } let instance = wallet.instance.clone().unwrap(); cancel_tx(instance, None, &None, Some(id), None).unwrap(); // Setup posting flag, and ability to finalize.