From 68da77db3332def539586064dd57bfe78f1b158b Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 14 Dec 2020 03:43:09 +0100 Subject: [PATCH] set blocktime to 32s --- src/chainparams.cpp | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 54f67cf09e..459fcafd4c 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -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; @@ -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; @@ -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; } }; @@ -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; @@ -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; @@ -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; } }; @@ -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; @@ -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; @@ -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(1,120); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,110); @@ -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 } @@ -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;