mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
Merge 27446 via benthecarman/configure-signet-blockitme
This commit is contained in:
commit
a7335c387e
@ -39,6 +39,15 @@ void ReadSigNetArgs(const ArgsManager& args, CChainParams::SigNetOptions& option
|
||||
}
|
||||
options.challenge.emplace(*val);
|
||||
}
|
||||
if (const auto signetblocktime{args.GetIntArg("-signetblocktime")}) {
|
||||
if (!args.IsArgSet("-signetchallenge")) {
|
||||
throw std::runtime_error("-signetblocktime cannot be set without -signetchallenge");
|
||||
}
|
||||
if (*signetblocktime <= 0) {
|
||||
throw std::runtime_error("-signetblocktime must be greater than 0");
|
||||
}
|
||||
options.pow_target_spacing = *signetblocktime;
|
||||
}
|
||||
}
|
||||
|
||||
void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& options)
|
||||
|
@ -22,6 +22,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
|
||||
argsman.AddArg("-vbparams=deployment:start:end[:min_activation_height]", "Use given start/end times and min_activation_height for specified version bits deployment (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
|
||||
argsman.AddArg("-signet", "Use the signet chain. Equivalent to -chain=signet. Note that the network is defined by the -signetchallenge parameter", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
|
||||
argsman.AddArg("-signetchallenge", "Blocks must satisfy the given script to be considered valid (only for signet networks; defaults to the global default signet test network challenge)", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::CHAINPARAMS);
|
||||
argsman.AddArg("-signetblocktime", "Difficulty adjustment will target a block time of the given amount in seconds (only for custom signet networks, must have -signetchallenge set; defaults to 10 minutes)", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::CHAINPARAMS);
|
||||
argsman.AddArg("-signetseednode", "Specify a seed node for the signet network, in the hostname[:port] format, e.g. sig.net:1234 (may be used multiple times to specify multiple seed nodes; defaults to the global default signet test network seed node(s))", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::CHAINPARAMS);
|
||||
}
|
||||
|
||||
|
@ -459,7 +459,7 @@ public:
|
||||
consensus.CSVHeight = 1;
|
||||
consensus.SegwitHeight = 1;
|
||||
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
|
||||
consensus.nPowTargetSpacing = 10 * 60;
|
||||
consensus.nPowTargetSpacing = options.pow_target_spacing;
|
||||
consensus.fPowAllowMinDifficultyBlocks = false;
|
||||
consensus.enforce_BIP94 = false;
|
||||
consensus.fPowNoRetargeting = false;
|
||||
|
@ -137,6 +137,7 @@ public:
|
||||
struct SigNetOptions {
|
||||
std::optional<std::vector<uint8_t>> challenge{};
|
||||
std::optional<std::vector<std::string>> seeds{};
|
||||
int64_t pow_target_spacing{10 * 60};
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user