Skip to content

Commit b6ab350

Browse files
committed
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.
1 parent 6768389 commit b6ab350

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/init.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1044,12 +1044,12 @@ bool AppInitParameterInteraction(const ArgsManager& args)
10441044
if (args.GetBoolArg("-peerbloomfilters", DEFAULT_PEERBLOOMFILTERS))
10451045
g_local_services = ServiceFlags(g_local_services | NODE_BLOOM);
10461046

1047-
if (args.IsArgSet("-test")) {
1047+
const std::vector<std::string> test_options = args.GetArgs("-test");
1048+
if (!test_options.empty()) {
10481049
if (chainparams.GetChainType() != ChainType::REGTEST) {
10491050
return InitError(Untranslated("-test=<option> can only be used with regtest"));
10501051
}
1051-
const std::vector<std::string> options = args.GetArgs("-test");
1052-
for (const std::string& option : options) {
1052+
for (const std::string& option : test_options) {
10531053
auto it = std::find_if(TEST_OPTIONS_DOC.begin(), TEST_OPTIONS_DOC.end(), [&option](const std::string& doc_option) {
10541054
size_t pos = doc_option.find(" (");
10551055
return (pos != std::string::npos) && (doc_option.substr(0, pos) == option);

0 commit comments

Comments
 (0)