mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Fix nonsensical -notest behavior
Treat specifying -notest exactly the same as not specifying any -test value, instead of complaining that it must be used with -regtest.
This commit is contained in:
parent
6768389917
commit
b6ab350806
1 changed files with 3 additions and 3 deletions
|
@ -1044,12 +1044,12 @@ bool AppInitParameterInteraction(const ArgsManager& args)
|
||||||
if (args.GetBoolArg("-peerbloomfilters", DEFAULT_PEERBLOOMFILTERS))
|
if (args.GetBoolArg("-peerbloomfilters", DEFAULT_PEERBLOOMFILTERS))
|
||||||
g_local_services = ServiceFlags(g_local_services | NODE_BLOOM);
|
g_local_services = ServiceFlags(g_local_services | NODE_BLOOM);
|
||||||
|
|
||||||
if (args.IsArgSet("-test")) {
|
const std::vector<std::string> test_options = args.GetArgs("-test");
|
||||||
|
if (!test_options.empty()) {
|
||||||
if (chainparams.GetChainType() != ChainType::REGTEST) {
|
if (chainparams.GetChainType() != ChainType::REGTEST) {
|
||||||
return InitError(Untranslated("-test=<option> can only be used with regtest"));
|
return InitError(Untranslated("-test=<option> can only be used with regtest"));
|
||||||
}
|
}
|
||||||
const std::vector<std::string> options = args.GetArgs("-test");
|
for (const std::string& option : test_options) {
|
||||||
for (const std::string& option : options) {
|
|
||||||
auto it = std::find_if(TEST_OPTIONS_DOC.begin(), TEST_OPTIONS_DOC.end(), [&option](const std::string& doc_option) {
|
auto it = std::find_if(TEST_OPTIONS_DOC.begin(), TEST_OPTIONS_DOC.end(), [&option](const std::string& doc_option) {
|
||||||
size_t pos = doc_option.find(" (");
|
size_t pos = doc_option.find(" (");
|
||||||
return (pos != std::string::npos) && (doc_option.substr(0, pos) == option);
|
return (pos != std::string::npos) && (doc_option.substr(0, pos) == option);
|
||||||
|
|
Loading…
Add table
Reference in a new issue