aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/system.cpp10
-rwxr-xr-xtest/functional/feature_includeconf.py2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index 3512bb8bff..a21d58a19d 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -337,14 +337,12 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
}
// we do not allow -includeconf from command line
- bool success = true;
if (auto* includes = util::FindKey(m_settings.command_line_options, "includeconf")) {
- for (const auto& include : util::SettingsSpan(*includes)) {
- error += "-includeconf cannot be used from commandline; -includeconf=" + include.write() + "\n";
- success = false;
- }
+ const auto& include{*util::SettingsSpan(*includes).begin()}; // pick first value as example
+ error = "-includeconf cannot be used from commandline; -includeconf=" + include.write();
+ return false;
}
- return success;
+ return true;
}
Optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) const
diff --git a/test/functional/feature_includeconf.py b/test/functional/feature_includeconf.py
index 8eb20adf5b..6a1f3b0ef1 100755
--- a/test/functional/feature_includeconf.py
+++ b/test/functional/feature_includeconf.py
@@ -48,7 +48,7 @@ class IncludeConfTest(BitcoinTestFramework):
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf=true',
)
self.nodes[0].assert_start_raises_init_error(
- extra_args=['-includeconf=relative2.conf'],
+ extra_args=['-includeconf=relative2.conf', '-includeconf=no_warn.conf'],
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf="relative2.conf"',
)