This commit is contained in:
Kks
2024-04-07 22:55:46 -04:00
parent f82f4cf7d6
commit b1c9de6f9a
3 changed files with 11 additions and 10 deletions

View File

@@ -64,7 +64,8 @@ class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = CBaseChainParams::MAIN;
consensus.nSubsidyHalvingInterval = 100000;
consensus.nSubsidyHalvingInterval = 210000;
consensus.BIP16Exception = uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
consensus.BIP34Height = 29000;
consensus.BIP34Hash = uint256();
@@ -74,14 +75,15 @@ public:
consensus.SegwitHeight = 29000;
consensus.MinBIP9WarningHeight = 29240; // segwit activation height + miner confirmation window
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.powLimitV2 = uint256S("000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 0.025 * 24 * 60 * 60;
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60;
consensus.nPowTargetSpacing = 10 * 60;
consensus.nPowTargetSpacingV2 = 2 * 60;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 180;
consensus.nMinerConfirmationWindow = 240;
consensus.nRuleChangeActivationThreshold = 1916;
consensus.nMinerConfirmationWindow = 2016;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999;

View File

@@ -73,7 +73,7 @@ struct Params {
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS];
/** Proof of work parameters */
uint256 powLimit;
uint256 powLimitV2;
bool fPowAllowMinDifficultyBlocks;
bool fPowNoRetargeting;
int64_t nPowTargetSpacing;

View File

@@ -14,13 +14,12 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
{
assert(pindexLast != nullptr);
unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
unsigned int nProofOfWorkLimitV2 = UintToArith256(params.powLimitV2).GetCompact();
// reset difficulty for new diff algorithm's average + Segwit/CSV activation
if (pindexLast->nHeight >= 28927)
return nProofOfWorkLimitV2;
if (pindexLast->nHeight >= 28928)
return nProofOfWorkLimit;
if (pindexLast->nHeight >= 28930)
if (pindexLast->nHeight >= 29000)
return LwmaCalculateNextWorkRequired(pindexLast, params);
// Only change once per difficulty adjustment interval