From c5206e16e321caefddaf61feddddb711af6b0cac Mon Sep 17 00:00:00 2001 From: Jaquee Date: Mon, 12 Dec 2016 22:51:20 +0100 Subject: [PATCH] Use daemon height if target height = 0 --- src/libwalletqt/Wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 5eb9cb46..64c7af2c 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -192,6 +192,11 @@ quint64 Wallet::daemonBlockChainTargetHeight() const if (m_daemonBlockChainTargetHeight == 0 || m_daemonBlockChainTargetHeightTime.elapsed() / 1000 > m_daemonBlockChainTargetHeightTtl) { m_daemonBlockChainTargetHeight = m_walletImpl->daemonBlockChainTargetHeight(); + // Target height is set to 0 if daemon is synced. + // Use current height from daemon when target height < current height + if (m_daemonBlockChainTargetHeight < m_daemonBlockChainHeight){ + m_daemonBlockChainTargetHeight = m_daemonBlockChainHeight; + } m_daemonBlockChainTargetHeightTime.restart(); }