reset difficulty

This commit is contained in:
wowario 2019-02-05 18:30:38 +03:00
parent df637cd08c
commit d498b2d791
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -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