From 2e3826cbcd675dcd1d03970233ba5e143e09eb75 Mon Sep 17 00:00:00 2001 From: josibake Date: Fri, 29 Jul 2022 13:56:43 +0200 Subject: [PATCH] util: warn if reindex is used in conf using reindex in a conf file can lead to the node reindexing on every restart. we still allow it but throw a warning. --- src/util/system.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/system.cpp b/src/util/system.cpp index 948b3f2673..390d58b63b 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -940,6 +940,12 @@ bool IsConfSupported(KeyInfo& key, std::string& error) { error = "conf cannot be set in the configuration file; use includeconf= if you want to include additional config files"; return false; } + if (key.name == "reindex") { + // reindex can be set in a config file but it is strongly discouraged as this will cause the node to reindex on + // every restart. Allow the config but throw a warning + LogPrintf("Warning: reindex=1 is set in the configuration file, which will significantly slow down startup. Consider removing or commenting out this option for better performance, unless there is currently a condition which makes rebuilding the indexes necessary\n"); + return true; + } return true; }