mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02: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:
parent
c93ef43e4f
commit
c711ca186f
3 changed files with 39 additions and 9 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue