From 8e2ecfe2496d8a015f3ee8723025a438feffbd28 Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Wed, 11 Dec 2019 16:41:40 -0500 Subject: validation: add CChainState.m_from_snapshot_blockhash This parameter is unused, but in future commits will allow ChainstateManager to differentiate between chainstates created from a UTXO snapshot from those that weren't. --- src/validation.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/validation.cpp') diff --git a/src/validation.cpp b/src/validation.cpp index a5b68e4eb..31b78380a 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( leveldb_name, cache_size_bytes, in_memory, should_wipe); } -- cgit v1.2.3