Auto merge of #4176 - oxarbitrage:issue3161, r=str4d

avoid blockchain progress greater than 1.0

Closes #3161
This commit is contained in:
Homu 2019-12-09 16:02:14 +00:00
commit 34d428aa43
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ namespace Checkpoints {
fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor; fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor;
} }
return fWorkBefore / (fWorkBefore + fWorkAfter); return std::min(fWorkBefore / (fWorkBefore + fWorkAfter), 1.0);
} }
int GetTotalBlocksEstimate(const CCheckpointData& data) int GetTotalBlocksEstimate(const CCheckpointData& data)