aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-08-07 15:13:45 +0200
committerRiccardo Spagni <ric@spagni.net>2017-08-07 15:13:45 +0200
commitb1af32b48d2b8843a1c5bc728a9f564267474304 (patch)
tree897e1c716428ef20967bfd8ddfeef93d8e447144 /src/cryptonote_protocol
parentMerge pull request #2239 (diff)
parentcryptonote_protocol: fix days behind calc on testnet (diff)
downloadmonero-b1af32b48d2b8843a1c5bc728a9f564267474304.tar.xz
Merge pull request #2242
1c9196b0 cryptonote_protocol: fix days behind calc on testnet (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_protocol')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index edf041f48..f3d6429a2 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -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) "