aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index a5b68e4ebd..31b78380af 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1244,7 +1244,9 @@ void CoinsViews::InitCache()
// NOTE: for now m_blockman is set to a global, but this will be changed
// in a future commit.
-CChainState::CChainState() : m_blockman(g_blockman) {}
+CChainState::CChainState(uint256 from_snapshot_blockhash)
+ : m_blockman(g_blockman),
+ m_from_snapshot_blockhash(from_snapshot_blockhash) {}
void CChainState::InitCoinsDB(
@@ -1253,6 +1255,10 @@ void CChainState::InitCoinsDB(
bool should_wipe,
std::string leveldb_name)
{
+ if (!m_from_snapshot_blockhash.IsNull()) {
+ leveldb_name += "_" + m_from_snapshot_blockhash.ToString();
+ }
+
m_coins_views = MakeUnique<CoinsViews>(
leveldb_name, cache_size_bytes, in_memory, should_wipe);
}