From d498b2d7915d7f20d8dae08539f1ecff560aeab1 Mon Sep 17 00:00:00 2001 From: wowario Date: Tue, 5 Feb 2019 18:30:38 +0300 Subject: [PATCH] reset difficulty --- src/cryptonote_basic/difficulty.cpp | 4 ++-- src/cryptonote_config.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cryptonote_basic/difficulty.cpp b/src/cryptonote_basic/difficulty.cpp index f92b550fa..88952a87b 100644 --- a/src/cryptonote_basic/difficulty.cpp +++ b/src/cryptonote_basic/difficulty.cpp @@ -279,8 +279,8 @@ namespace cryptonote { size_t length = timestamps.size(); assert(length == cumulative_difficulties.size()); - if (length <= 1) { - return 1; + if (length < DIFFICULTY_FORK_HEIGHT + 72) { + return DIFFICULTY_RESET; } static_assert(DIFFICULTY_WINDOW_V3 >= 2, "Window is too small"); assert(length <= DIFFICULTY_WINDOW_V3); diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index ddc3d442a..1a87922bc 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -90,7 +90,8 @@ #define DIFFICULTY_BLOCKS_COUNT_V3 DIFFICULTY_WINDOW_V3 + DIFFICULTY_LAG_V2 #define DIFFICULTY_BLOCKS_COUNT_V2 DIFFICULTY_WINDOW_V2 + 1 // added +1 to make N=N #define DIFFICULTY_BLOCKS_COUNT DIFFICULTY_WINDOW + DIFFICULTY_LAG - +#define DIFFICULTY_FORK_HEIGHT 80969 // ~14 February 2019 +#define DIFFICULTY_RESET 10000000 // 10 million #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1 DIFFICULTY_TARGET_V1 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 DIFFICULTY_TARGET_V2 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS