Skip to content

Commit

Permalink
Merge pull request graft-project#61 from mbg033/wallet-fix-refresh-fr…
Browse files Browse the repository at this point in the history
…om-block-height

get_approximate_blockchain_height: handle future hardfork
  • Loading branch information
laid37 authored Jan 13, 2018
2 parents 9669bdd + 4693d10 commit 7276dd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/supernode/graft_wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5674,6 +5674,11 @@ uint64_t GraftWallet::get_approximate_blockchain_height() const
{
// time of begining: testnet: 2018-01-12, mainnet: 2018-01-18;
const time_t fork_time = m_testnet ? 1515715200 : 1516233600;

// in case we not launched mainnet yet
if (fork_time > time(nullptr))
return 0;

// v2 fork block
const uint64_t fork_block = m_testnet ? 1 : 1;
// avg seconds per block
Expand Down
5 changes: 5 additions & 0 deletions src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5120,6 +5120,11 @@ uint64_t wallet2::get_approximate_blockchain_height() const
{
// time of begining: testnet: 2018-01-12, mainnet: 2018-01-18;
const time_t fork_time = m_testnet ? 1515715200 : 1516233600;

// in case we not launched mainnet yet
if (fork_time > time(nullptr))
return 0;

// v2 fork block
const uint64_t fork_block = m_testnet ? 1 : 1;
// avg seconds per block
Expand Down

0 comments on commit 7276dd7

Please sign in to comment.