nudge estimate_blockchain_height

This commit is contained in:
wowario 2020-09-22 06:57:10 +03:00
parent f9c0871877
commit 2aabc5863e
No known key found for this signature in database
GPG key ID: 24DCBE762DE9C111

View file

@ -4726,7 +4726,7 @@ crypto::secret_key wallet2::generate(const std::string& wallet_, const epee::wip
// avg seconds per block // avg seconds per block
const int seconds_per_block = DIFFICULTY_TARGET_V2; const int seconds_per_block = DIFFICULTY_TARGET_V2;
// ~num blocks per month // ~num blocks per month
const uint64_t blocks_per_month = 60*60*24*30/seconds_per_block; const uint64_t blocks_per_month = 288*30;
// try asking the daemon first // try asking the daemon first
std::string err; std::string err;
@ -12113,7 +12113,7 @@ uint64_t wallet2::get_daemon_blockchain_target_height(string &err)
uint64_t wallet2::get_approximate_blockchain_height() const uint64_t wallet2::get_approximate_blockchain_height() const
{ {
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/317; uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/315;
LOG_PRINT_L2("Calculated blockchain height: " << approx_blockchain_height); LOG_PRINT_L2("Calculated blockchain height: " << approx_blockchain_height);
return approx_blockchain_height; return approx_blockchain_height;
} }