Skip to content

Commit

Permalink
set blocktime to 32s
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil committed Dec 14, 2020
1 parent d27a047 commit 68da77d
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ class CMainParams : public CChainParams {
consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.posLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.QIP9PosLimit = uint256S("0000000000001fffffffffffffffffffffffffffffffffffffffffffffffffff"); // The new POS-limit activated after QIP9
consensus.RBTPosLimit = uint256S("000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.RBTPosLimit = uint256S("0000000000003fffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 16 * 60; // 16 minutes
consensus.nPowTargetTimespanV2 = 4000;
consensus.nRBTPowTargetTimespan = 500;
consensus.nPowTargetSpacing = 2 * 64;
consensus.nRBTPowTargetSpacing = 16;
consensus.nRBTPowTargetSpacing = 32;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = true;
consensus.fPoSNoRetargeting = false;
Expand Down Expand Up @@ -182,6 +182,10 @@ class CMainParams : public CChainParams {
0.02433574394826639 // * estimated number of transactions per second after that timestamp
};

consensus.nBlocktimeDownscaleFactor = 4;
consensus.nCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = consensus.nBlocktimeDownscaleFactor*500;

consensus.nLastPOWBlock = 5000;
consensus.nLastBigReward = 5000;
consensus.nMPoSRewardRecipients = 10;
Expand All @@ -193,14 +197,11 @@ class CMainParams : public CChainParams {

consensus.nFixUTXOCacheHFHeight = 100000;
consensus.nEnableHeaderSignatureHeight = 399100;
consensus.nCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = 500;
consensus.nCheckpointSpan = consensus.nCoinbaseMaturity;
consensus.nRBTCheckpointSpan = consensus.nRBTCoinbaseMaturity;
consensus.delegationsAddress = uint160(ParseHex("0000000000000000000000000000000000000086")); // Delegations contract for offline staking
consensus.nStakeTimestampMask = 15;
consensus.nRBTStakeTimestampMask = 7;
consensus.nBlocktimeDownscaleFactor = 8;
}
};

Expand Down Expand Up @@ -231,12 +232,12 @@ class CTestNetParams : public CChainParams {
consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.posLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.QIP9PosLimit = uint256S("0000000000001fffffffffffffffffffffffffffffffffffffffffffffffffff"); // The new POS-limit activated after QIP9
consensus.RBTPosLimit = uint256S("000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.RBTPosLimit = uint256S("0000000000003fffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 16 * 60; // 16 minutes
consensus.nPowTargetTimespanV2 = 4000;
consensus.nRBTPowTargetTimespan = 500;
consensus.nPowTargetSpacing = 2 * 64;
consensus.nRBTPowTargetSpacing = 16;
consensus.nRBTPowTargetSpacing = 32;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = true;
consensus.fPoSNoRetargeting = false;
Expand Down Expand Up @@ -307,6 +308,10 @@ class CTestNetParams : public CChainParams {
0.016913121136215
};

consensus.nBlocktimeDownscaleFactor = 4;
consensus.nCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = consensus.nBlocktimeDownscaleFactor*500;

consensus.nLastPOWBlock = 5000;
consensus.nLastBigReward = 5000;
consensus.nMPoSRewardRecipients = 10;
Expand All @@ -317,14 +322,11 @@ class CTestNetParams : public CChainParams {

consensus.nFixUTXOCacheHFHeight = 84500;
consensus.nEnableHeaderSignatureHeight = 391993;
consensus.nCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = 500;
consensus.nCheckpointSpan = consensus.nCoinbaseMaturity;
consensus.nRBTCheckpointSpan = consensus.nRBTCoinbaseMaturity;
consensus.delegationsAddress = uint160(ParseHex("0000000000000000000000000000000000000086")); // Delegations contract for offline staking
consensus.nStakeTimestampMask = 15;
consensus.nRBTStakeTimestampMask = 7;
consensus.nBlocktimeDownscaleFactor = 8;
}
};

Expand Down Expand Up @@ -360,7 +362,7 @@ class CRegTestParams : public CChainParams {
consensus.nPowTargetTimespanV2 = 4000;
consensus.nRBTPowTargetTimespan = 500;
consensus.nPowTargetSpacing = 2 * 64;
consensus.nRBTPowTargetSpacing = 16;
consensus.nRBTPowTargetSpacing = 32;
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.fPoSNoRetargeting = true;
Expand Down Expand Up @@ -412,6 +414,11 @@ class CRegTestParams : public CChainParams {
0,
0
};

consensus.nBlocktimeDownscaleFactor = 4;
consensus.nCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = consensus.nBlocktimeDownscaleFactor*500;

consensus.nLastPOWBlock = 0x7fffffff;
consensus.nLastBigReward = 5000;
consensus.nMPoSRewardRecipients = 10;
Expand All @@ -420,14 +427,12 @@ class CRegTestParams : public CChainParams {

consensus.nFixUTXOCacheHFHeight=0;
consensus.nEnableHeaderSignatureHeight = 0;
consensus.nCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = 500;

consensus.nCheckpointSpan = consensus.nCoinbaseMaturity;
consensus.nRBTCheckpointSpan = consensus.nRBTCoinbaseMaturity;
consensus.delegationsAddress = uint160(ParseHex("0000000000000000000000000000000000000086")); // Delegations contract for offline staking
consensus.nStakeTimestampMask = 15;
consensus.nRBTStakeTimestampMask = 7;
consensus.nBlocktimeDownscaleFactor = 8;

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,120);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,110);
Expand Down Expand Up @@ -515,8 +520,11 @@ class CUnitTestParams : public CRegTestParams
consensus.nSubsidyHalvingIntervalV2 = 6000;
consensus.nRuleChangeActivationThreshold = 558; // 75% for testchains
consensus.nMinerConfirmationWindow = 744; // Faster than normal for regtest (744 instead of 2016)

consensus.nBlocktimeDownscaleFactor = 4;
consensus.nCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = 500;
consensus.nRBTCoinbaseMaturity = consensus.nBlocktimeDownscaleFactor*500;

consensus.nCheckpointSpan = 1000; // Increase the check point span for the reorganization tests from 500 to 1000
consensus.nRBTCheckpointSpan = 1000; // Increase the check point span for the reorganization tests from 500 to 1000
}
Expand Down Expand Up @@ -607,7 +615,7 @@ void CChainParams::UpdateDifficultyChangeBlockHeight(int nHeight)
consensus.nSubsidyHalvingIntervalV2 = 7884000; // qtum halving every 4 years (nSubsidyHalvingInterval * nBlocktimeDownscaleFactor)
consensus.posLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.QIP9PosLimit = uint256S("0000000000001fffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.RBTPosLimit = uint256S("000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.RBTPosLimit = uint256S("0000000000003fffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.QIP9Height = nHeight;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = true;
Expand Down

0 comments on commit 68da77d

Please sign in to comment.