PPCoin: Fix bug in target adjustment since 32e6e50a
authorSunny King <sunnyking9999@gmail.com>
Sun, 29 Apr 2012 18:40:40 +0000 (19:40 +0100)
committerSunny King <sunnyking9999@gmail.com>
Sun, 29 Apr 2012 18:40:40 +0000 (19:40 +0100)
src/main.cpp

index 0866ab0..9fd19e3 100644 (file)
@@ -756,7 +756,7 @@ unsigned int static GetNextTargetRequired(const CBlockIndex* pindexLast, bool fP
     // ppcoin: target change every block
     // ppcoin: retarget with exponential moving toward target spacing
     CBigNum bnNew;
-    bnNew.SetCompact(pindexLast->nBits);
+    bnNew.SetCompact(pindexPrev->nBits);
     bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
     bnNew /= ((nInterval + 1) * nTargetSpacing);