chainparams: make deployment configuration available on all test networks

This allows unit tests to set `-testactivationheight` and `-vbparams` on
all networks instead of exclusively on regtest. Those are kept
test-network-only when used as startup parameters.
This commit is contained in:
Antoine Poinsot
2025-09-29 13:56:32 -04:00
parent df7ed5f355
commit 4995c00a9c
5 changed files with 70 additions and 20 deletions

View File

@@ -1125,6 +1125,16 @@ bool AppInitParameterInteraction(const ArgsManager& args)
}
}
// Prevent setting deployment parameters on mainnet.
if (chainparams.GetChainType() == ChainType::MAIN) {
if (args.IsArgSet("-testactivationheight")) {
return InitError(_("The -testactivationheight option may not be used on mainnet."));
}
if (args.IsArgSet("-vbparams")) {
return InitError(_("The -vbparams option may not be used on mainnet."));
}
}
// Also report errors from parsing before daemonization
{
kernel::Notifications notifications{};