From: gg Date: Sun, 18 Jan 2026 21:28:39 +0000 (-0500) Subject: move syncPause checks to top of refresh thread loop X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=f99a21476d834081403cd97947c12ce44b892438;p=gamesguru%2Ffeather.git move syncPause checks to top of refresh thread loop --- diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index a6fef448..525d539c 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -528,6 +528,17 @@ void Wallet::startRefreshThread() continue; } + // Scan mempool if paused, low-bandwidth query if user has enabled it + if (m_syncPaused) { + if (m_refreshNow || conf()->get(Config::scanMempoolWhenPaused).toBool()) { + qDebug() << "[SYNC PAUSED] Scanning mempool because scans are enabled"; + scanMempool(); + m_refreshNow = false; + } + last = std::chrono::steady_clock::now(); + continue; + } + m_refreshNow = false; auto loopStartTime = std::chrono::time_point_cast(std::chrono::steady_clock::now()); // get daemonHeight and targetHeight @@ -574,19 +585,6 @@ void Wallet::startRefreshThread() quint64 walletHeight = m_walletImpl->blockChainHeight(); m_walletImpl->refresh(); } - - // Scan mempool if paused - // Low-bandwidth query if user has enabled it - if (m_syncPaused) { - if (m_refreshNow || conf()->get(Config::scanMempoolWhenPaused).toBool()) { - scanMempool(); - m_refreshNow = false; - } else { - std::this_thread::sleep_for(std::chrono::milliseconds(250)); - } - last = std::chrono::steady_clock::now(); - continue; - } } }