Skip to content

Commit

Permalink
Fully tested fix of syncronization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Grandpa Jones committed Jul 20, 2015
1 parent 43b21de commit bc8396f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.cpp
Expand Up @@ -1376,11 +1376,15 @@ unsigned int ComputeMaxBits(CBigNum bnTargetLimit, unsigned int nBase, int64_t n
CBigNum bnResult;
bnResult.SetCompact(nBase);
bnResult *= 2;
if (fDebug && nTime > 0)
{
printf("ComputeMaxBits(): nTime <= 0 !\n");
}
while (nTime > 0 && bnResult < bnTargetLimit)
{
// Maximum 200% adjustment per 4 min
// Maximum 200% adjustment per 96 min
bnResult *= 2;
nTime -= 4 * 60; // 4 min
nTime -= 96 * 60;
}
if (bnResult > bnTargetLimit)
bnResult = bnTargetLimit;
Expand All @@ -1403,7 +1407,7 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime)
unsigned int ComputeMinStake(unsigned int nBase, int64_t nTime, unsigned int nBlockTime)
{
CBigNum bnProofOfStakeLimit_used;
if (nTime >= nPoSLimitSwitchTime)
if (nBlockTime >= nPoSLimitSwitchTime)
{
bnProofOfStakeLimit_used = bnProofOfStakeLimit_REVISED;
}
Expand Down

0 comments on commit bc8396f

Please sign in to comment.