Use chainparams factory for devnet (#3087)

This commit is contained in:
UdjinM6 2019-09-17 15:08:37 +03:00 committed by GitHub
parent ac90abe892
commit 0d126c2ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 17 deletions

View File

@ -106,6 +106,17 @@ void CChainParams::UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int
consensus.nSuperblockStartBlock = nSuperblockStartBlock; consensus.nSuperblockStartBlock = nSuperblockStartBlock;
} }
void CChainParams::UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
{
consensus.nMinimumDifficultyBlocks = nMinimumDifficultyBlocks;
consensus.nHighSubsidyBlocks = nHighSubsidyBlocks;
consensus.nHighSubsidyFactor = nHighSubsidyFactor;
}
void CChainParams::UpdateLLMQChainLocks(Consensus::LLMQType llmqType) {
consensus.llmqChainLocks = llmqType;
}
static CBlock FindDevNetGenesisBlock(const Consensus::Params& params, const CBlock &prevBlock, const CAmount& reward) static CBlock FindDevNetGenesisBlock(const Consensus::Params& params, const CBlock &prevBlock, const CAmount& reward)
{ {
std::string devNetName = GetDevNetName(); std::string devNetName = GetDevNetName();
@ -699,20 +710,7 @@ public:
0.01 // * estimated number of transactions per second 0.01 // * estimated number of transactions per second
}; };
} }
void UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
{
consensus.nMinimumDifficultyBlocks = nMinimumDifficultyBlocks;
consensus.nHighSubsidyBlocks = nHighSubsidyBlocks;
consensus.nHighSubsidyFactor = nHighSubsidyFactor;
}
void UpdateLLMQChainLocks(Consensus::LLMQType llmqType) {
consensus.llmqChainLocks = llmqType;
}
}; };
static CDevNetParams *devNetParams;
/** /**
* Regression test * Regression test
@ -887,12 +885,10 @@ void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymen
void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor) void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
{ {
assert(devNetParams); globalChainParams->UpdateSubsidyAndDiffParams(nMinimumDifficultyBlocks, nHighSubsidyBlocks, nHighSubsidyFactor);
devNetParams->UpdateSubsidyAndDiffParams(nMinimumDifficultyBlocks, nHighSubsidyBlocks, nHighSubsidyFactor);
} }
void UpdateDevnetLLMQChainLocks(Consensus::LLMQType llmqType) void UpdateDevnetLLMQChainLocks(Consensus::LLMQType llmqType)
{ {
assert(devNetParams); globalChainParams->UpdateLLMQChainLocks(llmqType);
devNetParams->UpdateLLMQChainLocks(llmqType);
} }

View File

@ -87,6 +87,8 @@ public:
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThreshold); void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThreshold);
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight); void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight);
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock); void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock);
void UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor);
void UpdateLLMQChainLocks(Consensus::LLMQType llmqType);
int PoolMinParticipants() const { return nPoolMinParticipants; } int PoolMinParticipants() const { return nPoolMinParticipants; }
int PoolMaxParticipants() const { return nPoolMaxParticipants; } int PoolMaxParticipants() const { return nPoolMaxParticipants; }
int FulfilledRequestExpireTime() const { return nFulfilledRequestExpireTime; } int FulfilledRequestExpireTime() const { return nFulfilledRequestExpireTime; }