add params to chainparams.cpp
This commit is contained in:
@@ -65,6 +65,7 @@ public:
|
|||||||
CMainParams() {
|
CMainParams() {
|
||||||
strNetworkID = CBaseChainParams::MAIN;
|
strNetworkID = CBaseChainParams::MAIN;
|
||||||
consensus.nSubsidyHalvingInterval = 210000;
|
consensus.nSubsidyHalvingInterval = 210000;
|
||||||
|
consensus.nResilienceForkHeight = 340000;
|
||||||
|
|
||||||
consensus.BIP16Exception = uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
|
consensus.BIP16Exception = uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
|
||||||
consensus.BIP34Height = 29000;
|
consensus.BIP34Height = 29000;
|
||||||
@@ -184,6 +185,7 @@ public:
|
|||||||
CTestNetParams() {
|
CTestNetParams() {
|
||||||
strNetworkID = CBaseChainParams::TESTNET;
|
strNetworkID = CBaseChainParams::TESTNET;
|
||||||
consensus.nSubsidyHalvingInterval = 210000;
|
consensus.nSubsidyHalvingInterval = 210000;
|
||||||
|
consensus.nResilienceForkHeight = 2000;
|
||||||
|
|
||||||
consensus.BIP34Height = 1700;
|
consensus.BIP34Height = 1700;
|
||||||
consensus.BIP34Hash = uint256();
|
consensus.BIP34Hash = uint256();
|
||||||
@@ -273,6 +275,7 @@ public:
|
|||||||
explicit CRegTestParams(const ArgsManager& args) {
|
explicit CRegTestParams(const ArgsManager& args) {
|
||||||
strNetworkID = CBaseChainParams::REGTEST;
|
strNetworkID = CBaseChainParams::REGTEST;
|
||||||
consensus.nSubsidyHalvingInterval = 150;
|
consensus.nSubsidyHalvingInterval = 150;
|
||||||
|
consensus.nResilienceForkHeight = 200;
|
||||||
consensus.BIP16Exception = uint256();
|
consensus.BIP16Exception = uint256();
|
||||||
consensus.BIP34Height = 0;
|
consensus.BIP34Height = 0;
|
||||||
consensus.BIP34Hash = uint256();
|
consensus.BIP34Hash = uint256();
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ struct BIP9Deployment {
|
|||||||
struct Params {
|
struct Params {
|
||||||
uint256 hashGenesisBlock;
|
uint256 hashGenesisBlock;
|
||||||
int nSubsidyHalvingInterval;
|
int nSubsidyHalvingInterval;
|
||||||
|
int nResilienceForkHeight;
|
||||||
/* Block hash that is excepted from BIP16 enforcement */
|
/* Block hash that is excepted from BIP16 enforcement */
|
||||||
uint256 BIP16Exception;
|
uint256 BIP16Exception;
|
||||||
/** Block height and hash at which BIP34 becomes active */
|
/** Block height and hash at which BIP34 becomes active */
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <pow.h>
|
#include <pow.h>
|
||||||
|
|
||||||
|
#include <chainparams.h>
|
||||||
#include <arith_uint256.h>
|
#include <arith_uint256.h>
|
||||||
#include <chain.h>
|
#include <chain.h>
|
||||||
#include <primitives/block.h>
|
#include <primitives/block.h>
|
||||||
@@ -29,7 +30,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
|||||||
return LwmaCalculateNextWorkRequired(pindexLast, params);
|
return LwmaCalculateNextWorkRequired(pindexLast, params);
|
||||||
|
|
||||||
// Palladium: Hard Fork at 350,000 for fast difficulty adjustment
|
// Palladium: Hard Fork at 350,000 for fast difficulty adjustment
|
||||||
if (pindexLast->nHeight + 1 >= 340000) {
|
if (pindexLast->nHeight + 1 >= params.nResilienceForkHeight) {
|
||||||
int64_t nIntervalNew = 60;
|
int64_t nIntervalNew = 60;
|
||||||
if ((pindexLast->nHeight + 1) % nIntervalNew != 0)
|
if ((pindexLast->nHeight + 1) % nIntervalNew != 0)
|
||||||
return pindexLast->nBits;
|
return pindexLast->nBits;
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|||||||
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, reason);
|
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, reason);
|
||||||
|
|
||||||
// Check OP_RETURN size based on activation height
|
// Check OP_RETURN size based on activation height
|
||||||
if (ChainActive().Height() < 340000) {
|
if (ChainActive().Height() < Params().GetConsensus().nResilienceForkHeight) {
|
||||||
for (const CTxOut& txout : tx.vout) {
|
for (const CTxOut& txout : tx.vout) {
|
||||||
if (txout.scriptPubKey.IsUnspendable() && txout.scriptPubKey.size() > 83) {
|
if (txout.scriptPubKey.IsUnspendable() && txout.scriptPubKey.size() > 83) {
|
||||||
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, "bad-txns-oversize-opreturn-prefork");
|
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, "bad-txns-oversize-opreturn-prefork");
|
||||||
|
|||||||
Reference in New Issue
Block a user