Expand bounds on difficulty adjustment

This commit is contained in:
Jack Grigg 2016-09-06 13:13:23 +12:00
parent cb708a99a5
commit 8f3ec042af
2 changed files with 6 additions and 6 deletions

View File

@ -42,8 +42,8 @@ public:
//consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowAveragingWindow = 17;
consensus.nPowMaxAdjustDown = 16; // 16% adjustment down
consensus.nPowMaxAdjustUp = 8; // 8% adjustment up
consensus.nPowMaxAdjustDown = 32; // 32% adjustment down
consensus.nPowMaxAdjustUp = 16; // 16% adjustment up
consensus.nPowTargetSpacing = 2.5 * 60;
consensus.fPowAllowMinDifficultyBlocks = false;
/**

View File

@ -50,13 +50,13 @@ BOOST_AUTO_TEST_CASE(get_next_work_lower_limit_actual)
SelectParams(CBaseChainParams::MAIN);
const Consensus::Params& params = Params().GetConsensus();
int64_t nLastRetargetTime = 1279295950; // NOTE: Not an actual block time
int64_t nLastRetargetTime = 1279296753; // NOTE: Not an actual block time
CBlockIndex pindexLast;
pindexLast.nHeight = 68543;
pindexLast.nTime = 1279297671; // Block #68543 of Bitcoin
// This represents an average difficulty in the current algorithm
pindexLast.nBits = 0x1c05a3f4;
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x1c05306f);
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x1c04bceb);
}
/* Test the constraint on the upper bound for actual time taken */
@ -65,13 +65,13 @@ BOOST_AUTO_TEST_CASE(get_next_work_upper_limit_actual)
SelectParams(CBaseChainParams::MAIN);
const Consensus::Params& params = Params().GetConsensus();
int64_t nLastRetargetTime = 1269207250; // NOTE: Not an actual block time
int64_t nLastRetargetTime = 1269205629; // NOTE: Not an actual block time
CBlockIndex pindexLast;
pindexLast.nHeight = 46367;
pindexLast.nTime = 1269211443; // Block #46367 of Bitcoin
// This represents an average difficulty in the current algorithm
pindexLast.nBits = 0x1c387f6f;
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x1c418995);
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x1c4a93bb);
}
BOOST_AUTO_TEST_CASE(GetBlockProofEquivalentTime_test)