aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2017-11-19 22:10:34 +0000
committerRoss Nicoll <[email protected]>2019-07-13 22:25:22 +0000
commit18c23eafe9ad5068d00809ac064fa95c4dea1351 (patch)
tree32485bfcff55ff2e59e492f59ab6f008d0904f71 /src
parentSync changes from Dogecoin 1.10 (diff)
downloaddiscoin-18c23eafe9ad5068d00809ac064fa95c4dea1351.tar.xz
discoin-18c23eafe9ad5068d00809ac064fa95c4dea1351.zip
Correct PoW calculation logic to use locally calculated difficulty
Diffstat (limited to 'src')
-rw-r--r--src/pow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pow.cpp b/src/pow.cpp
index 220dcba63..09e38cef0 100644
--- a/src/pow.cpp
+++ b/src/pow.cpp
@@ -55,9 +55,9 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
// Litecoin: This fixes an issue where a 51% attack can change difficulty at will.
// Go back the full period unless it's the first retarget after genesis. Code courtesy of Art Forz
- int blockstogoback = params.DifficultyAdjustmentInterval()-1;
- if ((pindexLast->nHeight+1) != params.DifficultyAdjustmentInterval())
- blockstogoback = params.DifficultyAdjustmentInterval();
+ int blockstogoback = difficultyAdjustmentInterval-1;
+ if ((pindexLast->nHeight+1) != difficultyAdjustmentInterval)
+ blockstogoback = difficultyAdjustmentInterval;
// Go back by what we want to be 14 days worth of blocks
int nHeightFirst = pindexLast->nHeight - blockstogoback;