diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 6893dacf89622..87f5d36269b76 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -659,6 +659,7 @@ class CDevNetParams : public CChainParams { UpdateDevnetLLMQInstantSendFromArgs(args); UpdateDevnetLLMQInstantSendDIP0024FromArgs(args); UpdateDevnetLLMQPlatformFromArgs(args); + UpdateDevnetLLMQMnhfFromArgs(args); UpdateLLMQDevnetParametersFromArgs(args); UpdateDevnetPowTargetSpacingFromArgs(args); @@ -737,6 +738,14 @@ class CDevNetParams : public CChainParams { consensus.llmqTypeAssetLocks = llmqType; } + /** + * Allows modifying the LLMQ type for Mnhf. + */ + void UpdateDevnetLLMQMnhf(Consensus::LLMQType llmqType) + { + consensus.llmqTypeMnhf = llmqType; + } + /** * Allows modifying PowTargetSpacing */ @@ -761,6 +770,7 @@ class CDevNetParams : public CChainParams { void UpdateDevnetLLMQInstantSendFromArgs(const ArgsManager& args); void UpdateDevnetLLMQInstantSendDIP0024FromArgs(const ArgsManager& args); void UpdateDevnetLLMQPlatformFromArgs(const ArgsManager& args); + void UpdateDevnetLLMQMnhfFromArgs(const ArgsManager& args); void UpdateDevnetPowTargetSpacingFromArgs(const ArgsManager& args); }; @@ -1321,6 +1331,28 @@ void CDevNetParams::UpdateDevnetLLMQPlatformFromArgs(const ArgsManager& args) UpdateDevnetLLMQPlatform(llmqType); } +void CDevNetParams::UpdateDevnetLLMQMnhfFromArgs(const ArgsManager& args) +{ + if (!args.IsArgSet("-llmqmnhf")) return; + + const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeMnhf); + assert(llmq_params_opt.has_value()); + + std::string strLLMQType = gArgs.GetArg("-llmqmnhf", std::string(llmq_params_opt->name)); + + Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE; + for (const auto& params : consensus.llmqs) { + if (params.name == strLLMQType) { + llmqType = params.type; + } + } + if (llmqType == Consensus::LLMQType::LLMQ_NONE) { + throw std::runtime_error("Invalid LLMQ type specified for -llmqmnhf."); + } + LogPrintf("Setting llmqmnhf to size=%ld\n", static_cast(llmqType)); + UpdateDevnetLLMQMnhf(llmqType); +} + void CDevNetParams::UpdateDevnetPowTargetSpacingFromArgs(const ArgsManager& args) { if (!args.IsArgSet("-powtargetspacing")) return; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index b834330f1b903..7187d58efafb0 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -28,6 +28,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman) argsman.AddArg("-llmqinstantsend=", "Override the default LLMQ type used for InstantSend. Allows using InstantSend with smaller LLMQs. (default: llmq_50_60, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-llmqinstantsenddip0024=", "Override the default LLMQ type used for InstantSendDIP0024. (default: llmq_60_75, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-llmqplatform=", "Override the default LLMQ type used for Platform. (default: llmq_100_67, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); + argsman.AddArg("-llmqmnhf=", "Override the default LLMQ type used for EHF. (default: llmq_50_60, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-llmqtestparams=:", "Override the default LLMQ size for the LLMQ_TEST quorum (default: 3:2, regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-llmqtestinstantsendparams=:", "Override the default LLMQ size for the LLMQ_TEST_INSTANTSEND quorums (default: 3:2, regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-powtargetspacing=", "Override the default PowTargetSpacing value in seconds (default: 2.5 minutes, devnet-only)", ArgsManager::ALLOW_INT, OptionsCategory::CHAINPARAMS);