Skip to content

Commit 2e3826c

Browse files
committed
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.
1 parent 5e744f4 commit 2e3826c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/system.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,12 @@ bool IsConfSupported(KeyInfo& key, std::string& error) {
940940
error = "conf cannot be set in the configuration file; use includeconf= if you want to include additional config files";
941941
return false;
942942
}
943+
if (key.name == "reindex") {
944+
// reindex can be set in a config file but it is strongly discouraged as this will cause the node to reindex on
945+
// every restart. Allow the config but throw a warning
946+
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");
947+
return true;
948+
}
943949
return true;
944950
}
945951

0 commit comments

Comments
 (0)