Merge pull request #56 from wowario/lwma-2

Implement LWMA-2 for HF v9
This commit is contained in:
jw
2018-06-13 20:02:44 -07:00
committed by GitHub
3 changed files with 44 additions and 2 deletions
+10 -2
View File
@@ -833,8 +833,12 @@ difficulty_type Blockchain::get_difficulty_for_next_block()
size_t target = DIFFICULTY_TARGET_V2;
if (version == 7) {
return next_difficulty(timestamps, difficulties, target);
} else {
}
else if (version == 8) {
return next_difficulty_v2(timestamps, difficulties, target);
}
else {
return next_difficulty_v3(timestamps, difficulties);
}
}
//------------------------------------------------------------------
@@ -1047,8 +1051,12 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std:
// calculate the difficulty target for the block and return it
if (version == 7) {
return next_difficulty(timestamps, cumulative_difficulties, target);
} else {
}
else if (version == 8) {
return next_difficulty_v2(timestamps, cumulative_difficulties, target);
}
else {
return next_difficulty_v3(timestamps, cumulative_difficulties);
}
}