Fix V1/V2 use of hard fork related parameters

Some of it uses hardcoded height, which will need some thinking
for next (voted upon) fork.
This commit is contained in:
moneromooo-monero
2016-01-29 15:09:17 +00:00
parent 60b064c759
commit 3b1d7e03fc
13 changed files with 89 additions and 45 deletions
+2 -1
View File
@@ -177,7 +177,8 @@ namespace cryptonote
void update(uint64_t height, bool force = false)
{
auto current_time = std::chrono::system_clock::now();
if (std::chrono::seconds(DIFFICULTY_TARGET / 2) < current_time - m_blockchain_height_update_time || m_blockchain_height <= height)
const auto node_update_threshold = std::chrono::seconds(DIFFICULTY_TARGET_V1 / 2); // use min of V1/V2
if (node_update_threshold < current_time - m_blockchain_height_update_time || m_blockchain_height <= height)
{
update_blockchain_height();
m_blockchain_height = (std::max)(m_blockchain_height, height);