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