aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2024-01-09 10:25:08 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2024-01-22 10:50:03 -0300
commite9014042a6bed8c16cc9a31fc35cb709d4b3c766 (patch)
treea031e1bf1d456af105ef757ee5ff9318be5299a2 /src/qt/test
parent966f5de99a9f5da05c91378ad1e8ea8ed37ac3b3 (diff)
downloadbitcoin-e9014042a6bed8c16cc9a31fc35cb709d4b3c766.tar.xz
settings: add auto-generated warning msg for editing the file manually
Hopefully, refraining users from modifying the file unless they are certain about the potential consequences. Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
Diffstat (limited to 'src/qt/test')
-rw-r--r--src/qt/test/optiontests.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qt/test/optiontests.cpp b/src/qt/test/optiontests.cpp
index e5a5179d87..7100603616 100644
--- a/src/qt/test/optiontests.cpp
+++ b/src/qt/test/optiontests.cpp
@@ -61,7 +61,11 @@ void OptionTests::migrateSettings()
QVERIFY(!settings.contains("addrSeparateProxyTor"));
std::ifstream file(gArgs.GetDataDirNet() / "settings.json");
+ std::string default_warning = strprintf("This file is automatically generated and updated by %s. Please do not edit this file while the node "
+ "is running, as any changes might be ignored or overwritten.",
+ PACKAGE_NAME);
QCOMPARE(std::string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()).c_str(), "{\n"
+ " \"_warning_\": \""+ default_warning+"\",\n"
" \"dbcache\": \"600\",\n"
" \"listen\": false,\n"
" \"onion\": \"onion:234\",\n"