aboutsummaryrefslogtreecommitdiff
path: root/src/common/settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/settings.cpp')
-rw-r--r--src/common/settings.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index cbf794a7c6..913ad6d76a 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -4,6 +4,10 @@
#include <common/settings.h>
+#if defined(HAVE_CONFIG_H)
+#include <config/bitcoin-config.h>
+#endif
+
#include <tinyformat.h>
#include <univalue.h>
#include <util/fs.h>
@@ -116,6 +120,13 @@ bool WriteSettings(const fs::path& path,
std::vector<std::string>& errors)
{
SettingsValue out(SettingsValue::VOBJ);
+ // Add auto-generated warning comment only if it does not exist
+ if (!values.contains("_warning_")) {
+ out.pushKV("_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));
+ }
+ // Push settings values
for (const auto& value : values) {
out.pushKVEnd(value.first, value.second);
}