mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Allow to override llmqChainLocks with "-llmqchainlocks" on devnet (#2683)
This commit is contained in:
parent
bed57cfbf6
commit
7e4257254c
@ -667,6 +667,10 @@ public:
|
||||
consensus.nHighSubsidyBlocks = nHighSubsidyBlocks;
|
||||
consensus.nHighSubsidyFactor = nHighSubsidyFactor;
|
||||
}
|
||||
|
||||
void UpdateLLMQChainLocks(Consensus::LLMQType llmqType) {
|
||||
consensus.llmqChainLocks = llmqType;
|
||||
}
|
||||
};
|
||||
static CDevNetParams *devNetParams;
|
||||
|
||||
@ -873,3 +877,9 @@ void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSub
|
||||
assert(devNetParams);
|
||||
devNetParams->UpdateSubsidyAndDiffParams(nMinimumDifficultyBlocks, nHighSubsidyBlocks, nHighSubsidyFactor);
|
||||
}
|
||||
|
||||
void UpdateDevnetLLMQChainLocks(Consensus::LLMQType llmqType)
|
||||
{
|
||||
assert(devNetParams);
|
||||
devNetParams->UpdateLLMQChainLocks(llmqType);
|
||||
}
|
||||
|
@ -162,4 +162,9 @@ void UpdateRegtestBudgetParameters(int nMasternodePaymentsStartBlock, int nBudge
|
||||
*/
|
||||
void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor);
|
||||
|
||||
/**
|
||||
* Allows modifying the LLMQ type for ChainLocks.
|
||||
*/
|
||||
void UpdateDevnetLLMQChainLocks(Consensus::LLMQType llmqType);
|
||||
|
||||
#endif // BITCOIN_CHAINPARAMS_H
|
||||
|
17
src/init.cpp
17
src/init.cpp
@ -1368,6 +1368,23 @@ bool AppInitParameterInteraction()
|
||||
return InitError("Difficulty and subsidy parameters may only be overridden on devnet.");
|
||||
}
|
||||
|
||||
if (chainparams.NetworkIDString() == CBaseChainParams::DEVNET) {
|
||||
std::string llmqChainLocks = GetArg("-llmqchainlocks", Params().GetConsensus().llmqs.at(Params().GetConsensus().llmqChainLocks).name);
|
||||
Consensus::LLMQType llmqType = Consensus::LLMQ_NONE;
|
||||
for (const auto& p : Params().GetConsensus().llmqs) {
|
||||
if (p.second.name == llmqChainLocks) {
|
||||
llmqType = p.first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (llmqType == Consensus::LLMQ_NONE) {
|
||||
return InitError("Invalid LLMQ type specified for -llmqchainlocks.");
|
||||
}
|
||||
UpdateDevnetLLMQChainLocks(llmqType);
|
||||
} else if (IsArgSet("-llmqchainlocks")) {
|
||||
return InitError("LLMQ type for ChainLocks can only be overridden on devnet.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user