aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2017-12-27 21:11:14 +0000
committerRoss Nicoll <[email protected]>2018-09-19 19:23:29 +0100
commita89d54c4b228c02a62e21039f318f5225aad2cf9 (patch)
tree115470cc09b4174ddcd3d48a251a1d8d7f2da548 /src/chainparams.cpp
parentSet SegWit timeout to zero to disable it (#1405) (diff)
downloaddiscoin-a89d54c4b228c02a62e21039f318f5225aad2cf9.tar.xz
discoin-a89d54c4b228c02a62e21039f318f5225aad2cf9.zip
Change BIP65/66 enforcement to match Dogecoin (#1403)
* Introduce first estimates at BIP lock-in blocks * Introduce Dogecoin BIP parameters * Re-introduce supermajority rules for BIP65 * Add BIP65 supermajority rules * Tighten v3 block constraints * Don't enforce coinbase in v2 blocks * Correct testnet majority params * Change to using base version when checking supermajority
Diffstat (limited to 'src/chainparams.cpp')
-rw-r--r--src/chainparams.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index 0ab4d8b4f..5e0e51f27 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -71,11 +71,14 @@ public:
CMainParams() {
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 100000;
- // XXX: BIP heights and hashes all need to be updated to Dogecoin values
- consensus.BIP34Height = 227931;
- consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
- consensus.BIP65Height = 388381; // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0
- consensus.BIP66Height = 363725; // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931
+ consensus.nMajorityEnforceBlockUpgrade = 1500;
+ consensus.nMajorityRejectBlockOutdated = 1900;
+ consensus.nMajorityWindow = 2000;
+ // BIP34 is never enforced in Dogecoin v2 blocks, so we enforce from v3
+ consensus.BIP34Height = 1034383;
+ consensus.BIP34Hash = uint256S("0x80d1364201e5df97e696c03bdd24dc885e8617b9de51e453c10a4f629b1e797a");
+ // consensus.BIP65Height = 1032483; // Not enabled in Doge yet
+ consensus.BIP66Height = 1034383; // 80d1364201e5df97e696c03bdd24dc885e8617b9de51e453c10a4f629b1e797a - this is the last block that could be v2, 1900 blocks past the last v2 block
consensus.powLimit = uint256S("0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20;
consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours
consensus.nPowTargetSpacing = 60; // 1 minute
@@ -182,11 +185,14 @@ public:
CTestNetParams() {
strNetworkID = "test";
consensus.nSubsidyHalvingInterval = 100000;
- // XXX: BIP heights and hashes all need to be updated to Dogecoin values
- consensus.BIP34Height = 21111;
- consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8");
- consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6
- consensus.BIP66Height = 330776; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182
+ consensus.nMajorityEnforceBlockUpgrade = 501;
+ consensus.nMajorityRejectBlockOutdated = 750;
+ consensus.nMajorityWindow = 1000;
+ // BIP34 is never enforced in Dogecoin v2 blocks, so we enforce from v3
+ consensus.BIP34Height = 708658;
+ consensus.BIP34Hash = uint256S("0x21b8b97dcdb94caa67c7f8f6dbf22e61e0cfe0e46e1fff3528b22864659e9b38");
+ // consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6
+ consensus.BIP66Height = 708658; // 21b8b97dcdb94caa67c7f8f6dbf22e61e0cfe0e46e1fff3528b22864659e9b38 - this is the last block that could be v2, 1900 blocks past the last v2 block
consensus.powLimit = uint256S("0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20;
consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours
consensus.nPowTargetSpacing = 60; // 1 minute
@@ -280,9 +286,12 @@ public:
CRegTestParams() {
strNetworkID = "regtest";
consensus.nSubsidyHalvingInterval = 150;
+ consensus.nMajorityEnforceBlockUpgrade = 750;
+ consensus.nMajorityRejectBlockOutdated = 950;
+ consensus.nMajorityWindow = 1000;
consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
consensus.BIP34Hash = uint256();
- consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
+ // consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
consensus.powLimit = uint256S("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1;
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks