Skip to content

Commit

Permalink
update blockchain height estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
valiant1x committed May 7, 2018
1 parent f7bfdc2 commit 7970f2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5084,8 +5084,8 @@ uint64_t wallet2::get_approximate_blockchain_height() const
{
// avg seconds per block
const int seconds_per_block = DIFFICULTY_TARGET_V2;
// Calculated blockchain height
uint64_t approx_blockchain_height = (time(NULL) - config::GENESIS_TIMESTAMP)/seconds_per_block;
// Calculated blockchain height with adjustment: as of May 6 2018 the blockchain is ~16 days slow
uint64_t approx_blockchain_height = (time(NULL) - (config::GENESIS_TIMESTAMP + 60*60*24*17))/seconds_per_block;
LOG_PRINT_L2("Calculated blockchain height: " << approx_blockchain_height);
return approx_blockchain_height;
}
Expand Down

0 comments on commit 7970f2c

Please sign in to comment.