diff options
author | James O'Beirne <james.obeirne@pm.me> | 2023-05-03 15:39:51 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2023-09-30 06:38:43 -0400 |
commit | c711ca186f8d8a28810be0beedcb615ddcf93163 (patch) | |
tree | 1f7d8f20f69004eaddec93e570d2cf6abd260472 /src/validation.h | |
parent | c93ef43e4fd4fbc1263cdc9e98ae5856830fe89e (diff) | |
download | bitcoin-c711ca186f8d8a28810be0beedcb615ddcf93163.tar.xz |
assumeutxo: remove snapshot during -reindex{-chainstate}
Removing a snapshot chainstate from disk (and memory) is consistent with
existing reindex operations.
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/validation.h b/src/validation.h index 319e40447b..4e9e91c299 100644 --- a/src/validation.h +++ b/src/validation.h @@ -848,9 +848,6 @@ private: //! Points to either the ibd or snapshot chainstate; indicates our //! most-work chain. //! - //! Once this pointer is set to a corresponding chainstate, it will not - //! be reset until init.cpp:Shutdown(). - //! //! This is especially important when, e.g., calling ActivateBestChain() //! on all chainstates because we are not able to hold ::cs_main going into //! that call. @@ -1203,6 +1200,10 @@ public: void ResetChainstates() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); + //! Remove the snapshot-based chainstate and all on-disk artifacts. + //! Used when reindex{-chainstate} is called during snapshot use. + [[nodiscard]] bool DeleteSnapshotChainstate() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); + //! Switch the active chainstate to one based on a UTXO snapshot that was loaded //! previously. Chainstate& ActivateExistingSnapshot(CTxMemPool* mempool, uint256 base_blockhash) |