From c923172ece60258bde8414140ca6536be9b0cbe2 Mon Sep 17 00:00:00 2001 From: gg Date: Tue, 20 Jan 2026 04:26:21 -0500 Subject: [PATCH] fix full sync --- src/libwalletqt/Wallet.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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); -- 2.52.0