diff --git a/src/util/system.cpp b/src/util/system.cpp index c3c6cbfef62..948b3f26736 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -935,6 +935,14 @@ static bool GetConfigOptions(std::istream& stream, const std::string& filepath, return true; } +bool IsConfSupported(KeyInfo& key, std::string& error) { + if (key.name == "conf") { + error = "conf cannot be set in the configuration file; use includeconf= if you want to include additional config files"; + return false; + } + return true; +} + bool ArgsManager::ReadConfigStream(std::istream& stream, const std::string& filepath, std::string& error, bool ignore_invalid_keys) { LOCK(cs_args); @@ -945,6 +953,7 @@ bool ArgsManager::ReadConfigStream(std::istream& stream, const std::string& file for (const std::pair& option : options) { KeyInfo key = InterpretKey(option.first); std::optional flags = GetArgFlags('-' + key.name); + if (!IsConfSupported(key, error)) return false; if (flags) { std::optional value = InterpretValue(key, &option.second, *flags, error); if (!value) {