Skip to content

Commit

Permalink
Auto merge of #2766 - syd0:remove-fPowAllowMinDifficultyBlocks, r=str4d
Browse files Browse the repository at this point in the history
Get rid of consensus.fPowAllowMinDifficultyBlocks.

This closes #1380
  • Loading branch information
zkbot committed Nov 27, 2017
2 parents 77f4d05 + dffc025 commit 9ce4859
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/chainparams.cpp
Expand Up @@ -49,7 +49,6 @@ class CMainParams : public CChainParams {
consensus.nPowMaxAdjustDown = 32; // 32% adjustment down
consensus.nPowMaxAdjustUp = 16; // 16% adjustment up
consensus.nPowTargetSpacing = 2.5 * 60;
consensus.fPowAllowMinDifficultyBlocks = false;
/**
* The message start string should be awesome! ⓩ❤
*/
Expand Down Expand Up @@ -211,7 +210,6 @@ class CTestNetParams : public CMainParams {
consensus.nMajorityWindow = 400;
consensus.powLimit = uint256S("07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.fPowAllowMinDifficultyBlocks = true;
pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0x1a;
pchMessageStart[2] = 0xf9;
Expand Down
1 change: 0 additions & 1 deletion src/consensus/params.h
Expand Up @@ -41,7 +41,6 @@ struct Params {
int nMajorityWindow;
/** Proof of work parameters */
uint256 powLimit;
bool fPowAllowMinDifficultyBlocks;
int64_t nPowAveragingWindow;
int64_t nPowMaxAdjustDown;
int64_t nPowMaxAdjustUp;
Expand Down
9 changes: 0 additions & 9 deletions src/miner.cpp
Expand Up @@ -100,10 +100,6 @@ class TxPriorityCompare
void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
{
pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());

// Updating time can change work required on testnet:
if (consensusParams.fPowAllowMinDifficultyBlocks)
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, consensusParams);
}

CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
Expand Down Expand Up @@ -714,11 +710,6 @@ void static BitcoinMiner()
// Update nNonce and nTime
pblock->nNonce = ArithToUint256(UintToArith256(pblock->nNonce) + 1);
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);
if (chainparams.GetConsensus().fPowAllowMinDifficultyBlocks)
{
// Changing pblock->nTime can change work required on testnet:
hashTarget.SetCompact(pblock->nBits);
}
}
}
}
Expand Down

0 comments on commit 9ce4859

Please sign in to comment.