Don't early out whenever we see max POS blocks in a row

This commit is contained in:
Michael Toutonghi
2018-05-20 11:30:01 -07:00
parent 3de80992e0
commit e38677b86b

View File

@@ -243,8 +243,10 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus::
if (idx[j].consecutive == true) if (idx[j].consecutive == true)
{ {
idx[j].solveTime = st; idx[j].solveTime = st;
if ((j - i) >= VERUS_MAX_CONSECUTIVE_POS) if (((j - i) + 1) >= VERUS_MAX_CONSECUTIVE_POS)
{ {
// if this is real time, return zero
if (i == (N - 1))
// target of 0 (virtually impossible), if we hit max consecutive POS blocks // target of 0 (virtually impossible), if we hit max consecutive POS blocks
nextTarget.SetCompact(0); nextTarget.SetCompact(0);
return nextTarget.GetCompact(); return nextTarget.GetCompact();