Skip to content

Commit

Permalink
Small chain validatino improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
miningplanet committed Dec 2, 2023
1 parent aef492e commit 6168411
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,22 @@ unsigned int GetNextWorkRequiredV3(const CBlockIndex* pindexLast, const Consensu
if (nAdjustments > 0) {
for (int i = 0; i < nAdjustments; i++)
{
if (bnNew > powLimit) {
bnNew = powLimit;
return bnNew.GetCompact();
}
bnNew *= 100;
bnNew /= multiplicator;
}
} else {
for (int i = 0; i < -nAdjustments; i++)
{
bnNew *= multiplicator;
bnNew /= 100;
if (bnNew > powLimit) {
bnNew = powLimit;
break;
return bnNew.GetCompact();
}
bnNew *= multiplicator;
bnNew /= 100;
}
}

Expand Down

0 comments on commit 6168411

Please sign in to comment.