From 604979709388e558289e4c935607e03745212189 Mon Sep 17 00:00:00 2001 From: wowario Date: Thu, 17 Jun 2021 15:51:25 +0300 Subject: [PATCH] adjust difficulty_blocks_count --- README.md | 2 +- src/cryptonote_basic/difficulty.cpp | 2 +- src/cryptonote_core/blockchain.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7b7c9afa1..f0b52bbc9 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ If you have a fix or code change, feel free to submit it as a pull request. Ahea Things to Do, Work in Progress, and Help Wanted tasks are tracked in the [Meta](https://git.wownero.com/wownero/meta/issues) repo. -Join `#wownero-dev` on IRC freenode to participate in development conversation. +Join `#wownero-dev` on IRC OFTC to participate in development conversation. ## Scheduled software upgrades diff --git a/src/cryptonote_basic/difficulty.cpp b/src/cryptonote_basic/difficulty.cpp index 416816592..da73987b2 100644 --- a/src/cryptonote_basic/difficulty.cpp +++ b/src/cryptonote_basic/difficulty.cpp @@ -215,7 +215,7 @@ namespace cryptonote { if (length <= 1) { return 1; } - if (HEIGHT < 200 && HEIGHT > 2 && m_nettype == TESTNET) { return 500; } + if (HEIGHT < 10 && HEIGHT > 2 && m_nettype == TESTNET) { return 500; } if (HEIGHT <= 55 + DIFFICULTY_WINDOW && HEIGHT >= 55 && m_nettype == TESTNET) { return 1337; } if (HEIGHT <= DIFFICULTY_RESET_HEIGHT + DIFFICULTY_WINDOW && HEIGHT >= DIFFICULTY_RESET_HEIGHT && m_nettype == MAINNET) { return DIFFICULTY_RESET_LEVEL; } static_assert(DIFFICULTY_WINDOW >= 2, "Window is too small"); diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 3f660831f..e27da6eb7 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -867,7 +867,7 @@ start: ss << "Re-locked, height " << height << ", tail id " << new_top_hash << (new_top_hash == top_hash ? "" : " (different)") << std::endl; top_hash = new_top_hash; uint8_t version = get_current_hard_fork_version(); - uint64_t difficulty_blocks_count = version >= 11 ? DIFFICULTY_BLOCKS_COUNT_V3 : version <= 10 && version >= 8 ? DIFFICULTY_BLOCKS_COUNT_V2 : DIFFICULTY_BLOCKS_COUNT; + uint64_t difficulty_blocks_count = version <= 17 && version >= 11 ? DIFFICULTY_BLOCKS_COUNT_V3 : version <= 10 && version >= 8 ? DIFFICULTY_BLOCKS_COUNT_V2 : DIFFICULTY_BLOCKS_COUNT; // ND: Speedup // 1. Keep a list of the last 735 (or less) blocks that is used to compute difficulty, @@ -985,7 +985,7 @@ start: MGINFO("START DUMP"); MGINFO(ss.str()); MGINFO("END DUMP"); - MGINFO("Please send wowario on Freenode #wownero-dev the contents of this log, from a couple dozen lines before START DUMP to END DUMP"); + MGINFO("Please send wowario on IRC OTFC #wownero-dev the contents of this log, from a couple dozen lines before START DUMP to END DUMP"); } return diff; } @@ -1017,7 +1017,7 @@ size_t Blockchain::recalculate_difficulties(boost::optional start_heig const uint64_t top_height = m_db->height() - 1; MGINFO("Recalculating difficulties from height " << start_height << " to height " << top_height); uint8_t version = get_current_hard_fork_version(); - uint64_t difficulty_blocks_count = version >= 11 ? DIFFICULTY_BLOCKS_COUNT_V3 : version <= 10 && version >= 8 ? DIFFICULTY_BLOCKS_COUNT_V2 : DIFFICULTY_BLOCKS_COUNT; + uint64_t difficulty_blocks_count = version <= 17 && version >= 11 ? DIFFICULTY_BLOCKS_COUNT_V3 : version <= 10 && version >= 8 ? DIFFICULTY_BLOCKS_COUNT_V2 : DIFFICULTY_BLOCKS_COUNT; std::vector timestamps; std::vector difficulties; timestamps.reserve(difficulty_blocks_count + 1); @@ -1301,7 +1301,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std: std::vector cumulative_difficulties; uint8_t version = get_current_hard_fork_version(); - size_t difficulty_blocks_count = version >= 11 ? DIFFICULTY_BLOCKS_COUNT_V3 : version <= 10 && version >= 8 ? DIFFICULTY_BLOCKS_COUNT_V2 : DIFFICULTY_BLOCKS_COUNT; + size_t difficulty_blocks_count = version <= 17 && version >= 11 ? DIFFICULTY_BLOCKS_COUNT_V3 : version <= 10 && version >= 8 ? DIFFICULTY_BLOCKS_COUNT_V2 : DIFFICULTY_BLOCKS_COUNT; // if the alt chain isn't long enough to calculate the difficulty target // based on its blocks alone, need to get more blocks from the main chain