From bc80c6371f543110e62896de3da8a66f7f9ae45b Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 22 Aug 2019 13:08:57 -0400 Subject: [PATCH] check m_syncing_thread_done after is_daemon_synced() since lock is lost --- src/wallet/monero_wallet.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index d6da71f..751a7af 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -3040,11 +3040,15 @@ namespace monero { // skip if daemon is not connected or synced if (m_is_connected && is_daemon_synced()) { - // rescan blockchain if requested - if (rescan) m_w2->rescan_blockchain(false); + // lock is lost on is_daemon_synced() so syncing could be disabled + if (!m_syncing_thread_done) { - // sync wallet - if (!m_syncing_thread_done) result = sync_aux(start_height); // lock is lost on is_daemon_synced() so syncing could be disabled + // rescan blockchain if requested + if (rescan) m_w2->rescan_blockchain(false); + + // sync wallet + result = sync_aux(start_height); + } } } while (!rescan && (rescan = m_rescan_on_sync.exchange(false))); // repeat if not rescanned and rescan was requested return result;