You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
index: Enable reindex-chainstate with active indexes
This is achieved by letting the index sync thread wait until
reindex-chainstate is finished.
This also disables the pruning check when reindexing the chainstate (which is
incompatible with prune mode) because there would be no chain at this point
in init.
"Warning: Reverting this setting requires re-downloading the entire blockchain. "
457
458
"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >=%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
458
459
argsman.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk. This will also rebuild active optional indexes.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
459
-
argsman.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead. Deactivate all optional indexes before running this.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
460
+
argsman.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
460
461
argsman.AddArg("-settings=<file>", strprintf("Specify path to dynamic settings data file. Can be disabled with -nosettings. File is written at runtime and not meant to be edited by users (use %s instead for custom settings). Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME, BITCOIN_SETTINGS_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
461
462
#if HAVE_SYSTEM
462
463
argsman.AddArg("-startupnotify=<cmd>", "Execute command on startup.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
if (args.GetBoolArg("-reindex-chainstate", false)) {
986
-
// indexes that must be deactivated to prevent index corruption, see #24630
987
-
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) {
988
-
returnInitError(_("-reindex-chainstate option is not compatible with -coinstatsindex. Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes."));
989
-
}
990
-
if (g_enabled_filter_types.count(BlockFilterType::BASIC)) {
991
-
returnInitError(_("-reindex-chainstate option is not compatible with -blockfilterindex. Please temporarily disable blockfilterindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes."));
992
-
}
993
-
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
994
-
returnInitError(_("-reindex-chainstate option is not compatible with -txindex. Please temporarily disable txindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes."));
995
-
}
996
-
}
997
-
998
986
#if defined(USE_SYSCALL_SANDBOX)
999
987
if (args.IsArgSet("-sandbox") && !args.IsArgNegated("-sandbox")) {
self.log.info("Test that -reindex-chainstate is disallowed with coinstatsindex")
238
+
self.log.info("Test that the index works with -reindex-chainstate")
238
239
239
-
self.stop_node(1)
240
-
self.nodes[1].assert_start_raises_init_error(
241
-
expected_msg='Error: -reindex-chainstate option is not compatible with -coinstatsindex. '
242
-
'Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
self.log.info("Test -blockfilterindex with -reindex-chainstate raises an error")
259
-
self.nodes[0].assert_start_raises_init_error(
260
-
expected_msg='Error: -reindex-chainstate option is not compatible with -blockfilterindex. '
261
-
'Please temporarily disable blockfilterindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
0 commit comments