aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2021-06-05 09:09:47 +0100
committerRoss Nicoll <[email protected]>2021-06-05 23:25:30 +0100
commit140871623d521050eb84e5aed986387590cce2ca (patch)
tree0516254c684056f736a3d1efddebd64bcfd04a35 /src
parentMerge pull request #2237 from mmicael1/1.21-dev-ci-cache-assets (diff)
downloaddiscoin-140871623d521050eb84e5aed986387590cce2ca.tar.xz
discoin-140871623d521050eb84e5aed986387590cce2ca.zip
Introduce AuxPoW chain parameters
Introduce AuxPoW chain parameters. These are not yet used, splitting these out to make validation easier.
Diffstat (limited to 'src')
-rw-r--r--src/chainparams.cpp16
-rw-r--r--src/consensus/params.h17
2 files changed, 33 insertions, 0 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index dd3e4a5a7..4a5546a5e 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -99,6 +99,10 @@ public:
consensus.fSimplifiedRewards = false;
consensus.fShortEarlyCoinbase = true;
+ consensus.nAuxpowChainId = 0x0062; // 98 - Josh Wise!
+ consensus.fStrictChainId = true;
+ consensus.nLegacyBlocksBefore = 371337;
+
/**
* The message start string is designed to be unlikely to occur in normal data.
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
@@ -216,6 +220,10 @@ public:
consensus.fSimplifiedRewards = false;
consensus.fShortEarlyCoinbase = true;
+ consensus.nAuxpowChainId = 0x0062; // 98 - Josh Wise!
+ consensus.fStrictChainId = false;
+ consensus.nLegacyBlocksBefore = 158100;
+
pchMessageStart[0] = 0xfc;
pchMessageStart[1] = 0xc1;
pchMessageStart[2] = 0xb7;
@@ -345,6 +353,10 @@ public:
consensus.fSimplifiedRewards = true;
consensus.fShortEarlyCoinbase = true;
+ consensus.nAuxpowChainId = 0x0062; // 98 - Josh Wise!
+ consensus.fStrictChainId = true;
+ consensus.nLegacyBlocksBefore = 0;
+
// message start is defined as the first 4 bytes of the sha256d of the block script
CHashWriter h(SER_DISK, 0);
h << consensus.signet_challenge;
@@ -417,6 +429,10 @@ public:
consensus.fSimplifiedRewards = true;
consensus.fShortEarlyCoinbase = false;
+ consensus.nAuxpowChainId = 0x0062; // 98 - Josh Wise!
+ consensus.fStrictChainId = true;
+ consensus.nLegacyBlocksBefore = 0;
+
pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0xbf;
pchMessageStart[2] = 0xb5;
diff --git a/src/consensus/params.h b/src/consensus/params.h
index b7223b2fc..baf841e33 100644
--- a/src/consensus/params.h
+++ b/src/consensus/params.h
@@ -95,6 +95,23 @@ struct Params {
bool fSimplifiedRewards;
bool fShortEarlyCoinbase;
+
+ /** Auxpow parameters */
+ int32_t nAuxpowChainId;
+ bool fStrictChainId;
+ int nLegacyBlocksBefore; // -1 for "always allow"
+
+ /**
+ * Check whether or not to allow legacy blocks at the given height.
+ * @param nHeight Height of the block to check.
+ * @return True if it is allowed to have a legacy version.
+ */
+ bool AllowLegacyBlocks(unsigned nHeight) const
+ {
+ if (nLegacyBlocksBefore < 0)
+ return true;
+ return static_cast<int> (nHeight) < nLegacyBlocksBefore;
+ }
};
} // namespace Consensus