Skip to content

Commit 247d574

Browse files
committed
Ignore unknown config file options for now
1 parent 04ce0d8 commit 247d574

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/bitcoind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static bool AppInit(int argc, char* argv[])
9696
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "").c_str());
9797
return false;
9898
}
99-
if (!gArgs.ReadConfigFiles(error)) {
99+
if (!gArgs.ReadConfigFiles(error, true)) {
100100
fprintf(stderr, "Error reading configuration file: %s\n", error.c_str());
101101
return false;
102102
}

src/interfaces/node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class NodeImpl : public Node
5353
{
5454
return gArgs.ParseParameters(argc, argv, error);
5555
}
56-
bool readConfigFiles(std::string& error) override { return gArgs.ReadConfigFiles(error); }
56+
bool readConfigFiles(std::string& error) override { return gArgs.ReadConfigFiles(error, true); }
5757
bool softSetArg(const std::string& arg, const std::string& value) override { return gArgs.SoftSetArg(arg, value); }
5858
bool softSetBoolArg(const std::string& arg, bool value) override { return gArgs.SoftSetBoolArg(arg, value); }
5959
void selectParams(const std::string& network) override { SelectParams(network); }

test/functional/feature_includeconf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ def run_test(self):
5555
self.stop_node(0, expected_stderr="warning: -includeconf cannot be used from included files; ignoring -includeconf=relative2.conf")
5656

5757
self.log.info("-includeconf cannot contain invalid arg")
58-
with open(os.path.join(self.options.tmpdir, "node0", "relative.conf"), "w", encoding="utf8") as f:
59-
f.write("foo=bar\n")
60-
self.nodes[0].assert_start_raises_init_error(expected_msg="Error reading configuration file: Invalid configuration value foo")
58+
59+
# Commented out as long as we ignore invalid arguments in configuration files
60+
#with open(os.path.join(self.options.tmpdir, "node0", "relative.conf"), "w", encoding="utf8") as f:
61+
# f.write("foo=bar\n")
62+
#self.nodes[0].assert_start_raises_init_error(expected_msg="Error reading configuration file: Invalid configuration value foo")
6163

6264
self.log.info("-includeconf cannot be invalid path")
6365
os.remove(os.path.join(self.options.tmpdir, "node0", "relative.conf"))

0 commit comments

Comments
 (0)