mirror of
https://github.com/monero-project/monero.git
synced 2024-12-14 12:26:31 +02:00
cryptonote_protocol: fix days behind calc on testnet
This commit is contained in:
parent
ab594cfee9
commit
1c9196b0c5
@ -270,7 +270,7 @@ namespace cryptonote
|
||||
m_core.set_target_blockchain_height(static_cast<int64_t>(hshd.current_height));
|
||||
int64_t diff = static_cast<int64_t>(hshd.current_height) - static_cast<int64_t>(m_core.get_current_blockchain_height());
|
||||
int64_t max_block_height = max(static_cast<int64_t>(hshd.current_height),static_cast<int64_t>(m_core.get_current_blockchain_height()));
|
||||
int64_t last_block_v1 = 1009826;
|
||||
int64_t last_block_v1 = m_core.get_testnet() ? 624633 : 1009826;
|
||||
int64_t diff_v2 = max_block_height > last_block_v1 ? min(abs(diff), max_block_height - last_block_v1) : 0;
|
||||
MCLOG(is_inital ? el::Level::Info : el::Level::Debug, "global", context << "Sync data returned a new top block candidate: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height
|
||||
<< " [Your node is " << std::abs(diff) << " blocks (" << ((abs(diff) - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) "
|
||||
|
Loading…
Reference in New Issue
Block a user