aboutsummaryrefslogtreecommitdiff
path: root/src/pow.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2017-11-19 22:10:34 +0000
committerRoss Nicoll <[email protected]>2018-09-19 19:23:29 +0100
commit0a403a2227dab68d861045ae1b2d5c8774db7101 (patch)
treef651f0acf23cbcc308d38eaf8bd44acdc32c787f /src/pow.cpp
parentSync changes from Dogecoin 1.10 (diff)
downloaddiscoin-0a403a2227dab68d861045ae1b2d5c8774db7101.tar.xz
discoin-0a403a2227dab68d861045ae1b2d5c8774db7101.zip
Correct PoW calculation logic to use locally calcualted difficulty
Diffstat (limited to 'src/pow.cpp')
-rw-r--r--src/pow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pow.cpp b/src/pow.cpp
index 8bbb66a70..b569e709a 100644
--- a/src/pow.cpp
+++ b/src/pow.cpp
@@ -58,9 +58,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;