From: gg Date: Tue, 20 Jan 2026 09:26:21 +0000 (-0500) Subject: fix full sync X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=c923172ece60258bde8414140ca6536be9b0cbe2;p=gamesguru%2Ffeather.git fix full sync --- diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 47bd1e3d..b55c3705 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -603,29 +603,29 @@ void Wallet::startRefreshThread() m_newWallet = false; } - quint64 walletHeight = m_walletImpl->blockChainHeight(); + quint64 walletHeight = m_walletImpl->blockChainHeight(); - if (m_rangeSyncActive) { - uint64_t max_blocks = (m_stopHeight > walletHeight) ? (m_stopHeight - walletHeight) : 1; - uint64_t blocks_fetched = 0; - bool received_money = false; + if (m_rangeSyncActive) { + uint64_t max_blocks = (m_stopHeight > walletHeight) ? (m_stopHeight - walletHeight) : 1; + uint64_t blocks_fetched = 0; + bool received_money = false; - // Ensure we respect the wallet creation height (restore height) if it's set higher than current - uint64_t startHeight = std::max((uint64_t)walletHeight, m_wallet2->get_refresh_from_block_height()); + // Ensure we respect the wallet creation height (restore height) if it's set higher than current + uint64_t startHeight = std::max((uint64_t)walletHeight, m_wallet2->get_refresh_from_block_height()); - m_wallet2->refresh(m_wallet2->is_trusted_daemon(), startHeight, blocks_fetched, received_money, true, true, max_blocks); + m_wallet2->refresh(m_wallet2->is_trusted_daemon(), startHeight, blocks_fetched, received_money, true, true, max_blocks); - if (m_walletImpl->blockChainHeight() >= m_stopHeight) { - m_rangeSyncActive = false; - if (m_syncPaused) { - setConnectionStatus(ConnectionStatus_Idle); + if (m_walletImpl->blockChainHeight() >= m_stopHeight) { + m_rangeSyncActive = false; + if (m_syncPaused) { + setConnectionStatus(ConnectionStatus_Idle); + } } + } else { + m_walletImpl->refresh(); } - } else { - m_walletImpl->refresh(); } } - } } std::this_thread::sleep_for(intervalResolution);