Rename min-difficulty flag to remove off-by-one in the name

This commit is contained in:
Jack Grigg
2018-10-04 23:26:05 +01:00
parent b86dc98047
commit 1f7ee4af70
4 changed files with 10 additions and 8 deletions

View File

@@ -25,8 +25,10 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
return nProofOfWorkLimit;
{
if (params.nPowAllowMinDifficultyBlocksFromHeight &&
pindexLast->nHeight >= params.nPowAllowMinDifficultyBlocksFromHeight.get())
// Comparing to pindexLast->nHeight with >= because this function
// returns the work required for the block after pindexLast.
if (params.nPowAllowMinDifficultyBlocksAfterHeight &&
pindexLast->nHeight >= params.nPowAllowMinDifficultyBlocksAfterHeight.get())
{
// Special difficulty rule for testnet:
// If the new block's timestamp is more than 6 * 2.5 minutes