mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 02:18:52 +00:00
wallet api: prevent setting refresh height too high
This commit is contained in:
parent
dd580d7bc7
commit
29333c417e
@ -1010,9 +1010,6 @@ void WalletImpl::doRefresh()
|
|||||||
// Syncing daemon and refreshing wallet simultaneously is very resource intensive.
|
// Syncing daemon and refreshing wallet simultaneously is very resource intensive.
|
||||||
// Disable refresh if wallet is disconnected or daemon isn't synced.
|
// Disable refresh if wallet is disconnected or daemon isn't synced.
|
||||||
if (daemonSynced()) {
|
if (daemonSynced()) {
|
||||||
// Use fast refresh for new wallets
|
|
||||||
if (isNewWallet())
|
|
||||||
m_wallet->set_refresh_from_block_height(daemonBlockChainHeight());
|
|
||||||
m_wallet->refresh();
|
m_wallet->refresh();
|
||||||
if (!m_synchronized) {
|
if (!m_synchronized) {
|
||||||
m_synchronized = true;
|
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);
|
m_wallet->init(daemon_address, upper_transaction_size_limit);
|
||||||
|
|
||||||
// in case new wallet, this will force fast-refresh (pulling hashes instead of blocks)
|
// 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());
|
m_wallet->set_refresh_from_block_height(daemonBlockChainHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user