From e38677b86b35cf7abda6540ef487dac9f16a939c Mon Sep 17 00:00:00 2001 From: Michael Toutonghi Date: Sun, 20 May 2018 11:30:01 -0700 Subject: [PATCH] Don't early out whenever we see max POS blocks in a row --- src/pow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index cb9345bda..e4579c6ce 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -243,11 +243,13 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus:: if (idx[j].consecutive == true) { idx[j].solveTime = st; - if ((j - i) >= VERUS_MAX_CONSECUTIVE_POS) + if (((j - i) + 1) >= VERUS_MAX_CONSECUTIVE_POS) { - // target of 0 (virtually impossible), if we hit max consecutive POS blocks - nextTarget.SetCompact(0); - return nextTarget.GetCompact(); + // if this is real time, return zero + if (i == (N - 1)) + // target of 0 (virtually impossible), if we hit max consecutive POS blocks + nextTarget.SetCompact(0); + return nextTarget.GetCompact(); } st >>= 1; }