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.
This commit is contained in:
josibake 2022-07-29 13:56:43 +02:00
parent 5e744f4238
commit 2e3826cbcd
No known key found for this signature in database
GPG Key ID: 8ADCB558C4F33D65

View File

@ -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;
}