check m_syncing_thread_done after is_daemon_synced() since lock is lost

This commit is contained in:
woodser
2019-08-22 13:08:57 -04:00
parent 99361dc7b3
commit bc80c6371f
+8 -4
View File
@@ -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;