diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-01-08 16:39:23 -0800 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-01-08 16:39:23 -0800 |
commit | da0590052474da48444d10af18e64b3e6ea668f1 (patch) | |
tree | 7d362877062e66253af3deb28558a6649ab3bd4c /src/wallet | |
parent | Merge pull request #1508 (diff) | |
parent | wallet api: prevent setting refresh height too high (diff) | |
download | monero-da0590052474da48444d10af18e64b3e6ea668f1.tar.xz |
Merge pull request #1509
29333c41 wallet api: prevent setting refresh height too high (Jaquee)
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/api/wallet.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 3a4493ec3..5caa52257 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -1010,9 +1010,6 @@ void WalletImpl::doRefresh() // Syncing daemon and refreshing wallet simultaneously is very resource intensive. // Disable refresh if wallet is disconnected or daemon isn't synced. if (daemonSynced()) { - // Use fast refresh for new wallets - if (isNewWallet()) - m_wallet->set_refresh_from_block_height(daemonBlockChainHeight()); m_wallet->refresh(); if (!m_synchronized) { m_synchronized = true; @@ -1079,7 +1076,8 @@ void WalletImpl::doInit(const string &daemon_address, uint64_t upper_transaction m_wallet->init(daemon_address, upper_transaction_size_limit); // in case new wallet, this will force fast-refresh (pulling hashes instead of blocks) - if (isNewWallet()) { + // If daemon isn't synced a calculated block height will be used instead + if (isNewWallet() && daemonSynced()) { m_wallet->set_refresh_from_block_height(daemonBlockChainHeight()); } |