wallet2: fix refresh height calc for new wallets

This commit is contained in:
moneromooo-monero 2017-10-07 10:23:01 +01:00
parent 86e9de588c
commit 06fb9bcfcc
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 0 additions and 8 deletions

View File

@ -2223,14 +2223,6 @@ crypto::secret_key wallet2::generate(const std::string& wallet_, const std::stri
m_refresh_from_block_height = height >= blocks_per_month ? height - blocks_per_month : 0; m_refresh_from_block_height = height >= blocks_per_month ? height - blocks_per_month : 0;
} }
if(m_refresh_from_block_height == 0 && !recover){
// Wallets created offline don't know blockchain height.
// Set blockchain height calculated from current date/time
uint64_t approx_blockchain_height = get_approximate_blockchain_height();
if(approx_blockchain_height > 0) {
m_refresh_from_block_height = approx_blockchain_height >= blocks_per_month ? approx_blockchain_height - blocks_per_month : 0;
}
}
bool r = store_keys(m_keys_file, password, false); bool r = store_keys(m_keys_file, password, false);
THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, m_keys_file); THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, m_keys_file);