aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-05-26 13:18:18 +0100
committerfanquake <fanquake@gmail.com>2023-05-26 13:33:42 +0100
commit66b08e78226059e2d31450aadc2423d77003eaf1 (patch)
tree9c1a677f699072a99876311cb93d65413f6c978e /src/qt/test
parent4d13fe47be175d01a59147e514da554a88028e10 (diff)
parenteefe56967b4eb4b5144325cde4f40fc1cbde3e65 (diff)
Merge bitcoin/bitcoin#27302: init: Error if ignored bitcoin.conf file is found
eefe56967b4eb4b5144325cde4f40fc1cbde3e65 bugfix: Fix incorrect debug.log config file path (Ryan Ofsky) 3746f00be1b732a04976fc70cbb0661f97bbbd99 init: Error if ignored bitcoin.conf file is found (Ryan Ofsky) 398c3719b02197ad92fded20f6ff83b364747297 lint: Fix lint-format-strings false positives when format specifiers have argument positions (Ryan Ofsky) Pull request description: Show an error on startup if a bitcoin datadir that is being used contains a `bitcoin.conf` file that is ignored. There are two cases where this could happen: - One case reported in [#27246 (comment)](https://github.com/bitcoin/bitcoin/issues/27246#issuecomment-1470006043) happens when a `bitcoin.conf` file in the default datadir (e.g. `$HOME/.bitcoin/bitcoin.conf`) has a `datadir=/path` line that sets different datadir containing a second `bitcoin.conf` file. Currently the second `bitcoin.conf` file is ignored with no warning. - Another way this could happen is if a `-conf=` command line argument points to a configuration file with a `datadir=/path` line and that path contains a `bitcoin.conf` file, which is currently ignored. This change only adds an error message and doesn't change anything about way settings are applied. It also doesn't trigger errors if there are redundant `-datadir` or `-conf` settings pointing at the same configuration file, only if they are pointing at different files and one file is being ignored. ACKs for top commit: pinheadmz: re-ACK eefe56967b4eb4b5144325cde4f40fc1cbde3e65 willcl-ark: re-ACK eefe56967b TheCharlatan: ACK eefe56967b4eb4b5144325cde4f40fc1cbde3e65 Tree-SHA512: 939a98a4b271b5263d64a2df3054c56fcde94784edf6f010d78693a371c38aa03138ae9cebb026b6164bbd898d8fd0845a61a454fd996e328fd7bcf51c580c2b
Diffstat (limited to 'src/qt/test')
-rw-r--r--src/qt/test/test_main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index eaadbd7f7a..e45fc1ced8 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -71,6 +71,9 @@ int main(int argc, char* argv[])
gArgs.ForceSetArg("-upnp", "0");
gArgs.ForceSetArg("-natpmp", "0");
+ std::string error;
+ if (!gArgs.ReadConfigFiles(error, true)) QWARN(error.c_str());
+
// Prefer the "minimal" platform for the test instead of the normal default
// platform ("xcb", "windows", or "cocoa") so tests can't unintentionally
// interfere with any background GUIs and don't require extra resources.