Skip to content

Commit

Permalink
Merge pull request #44 from stellitecoin/refresh_fix
Browse files Browse the repository at this point in the history
Fix block height refresh estimation
  • Loading branch information
hayzamjs authored Jan 19, 2019
2 parents 58e49fc + b68fd55 commit 02a1cbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10152,11 +10152,11 @@ uint64_t wallet2::get_daemon_blockchain_target_height(string &err)
uint64_t wallet2::get_approximate_blockchain_height() const
{
// time of v2 fork
const time_t fork_time = m_nettype == TESTNET ? 1448285909 : m_nettype == STAGENET ? 1520937818 : 1458748658;
const time_t fork_time = m_nettype == TESTNET ? 1448285909 : m_nettype == STAGENET ? 1520937818 : 1520584977;
// v2 fork block
const uint64_t fork_block = m_nettype == TESTNET ? 624634 : m_nettype == STAGENET ? 32000 : 1009827;
const uint64_t fork_block = m_nettype == TESTNET ? 624634 : m_nettype == STAGENET ? 32000 : 67500;
// avg seconds per block
const int seconds_per_block = DIFFICULTY_TARGET_V2;
const int seconds_per_block = DIFFICULTY_TARGET_V5;
// Calculated blockchain height
uint64_t approx_blockchain_height = fork_block + (time(NULL) - fork_time)/seconds_per_block;
// testnet got some huge rollbacks, so the estimation is way off
Expand Down

0 comments on commit 02a1cbf

Please sign in to comment.