mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
assumeutxo: remove snapshot during -reindex{-chainstate}
Removing a snapshot chainstate from disk (and memory) is consistent with existing reindex operations.
This commit is contained in:
@@ -185,7 +185,14 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize
|
||||
chainman.InitializeChainstate(options.mempool);
|
||||
|
||||
// Load a chain created from a UTXO snapshot, if any exist.
|
||||
chainman.DetectSnapshotChainstate(options.mempool);
|
||||
bool has_snapshot = chainman.DetectSnapshotChainstate(options.mempool);
|
||||
|
||||
if (has_snapshot && (options.reindex || options.reindex_chainstate)) {
|
||||
LogPrintf("[snapshot] deleting snapshot chainstate due to reindexing\n");
|
||||
if (!chainman.DeleteSnapshotChainstate()) {
|
||||
return {ChainstateLoadStatus::FAILURE_FATAL, Untranslated("Couldn't remove snapshot chainstate.")};
|
||||
}
|
||||
}
|
||||
|
||||
auto [init_status, init_error] = CompleteChainstateInitialization(chainman, cache_sizes, options);
|
||||
if (init_status != ChainstateLoadStatus::SUCCESS) {
|
||||
|
||||
Reference in New Issue
Block a user