aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-12-11 16:41:40 -0500
committerJames O'Beirne <james.obeirne@pm.me>2020-03-17 13:27:39 -0400
commit8e2ecfe2496d8a015f3ee8723025a438feffbd28 (patch)
tree5e9c5694508d57a7317d66e14f310f31e056aeec /src/validation.cpp
parentd2d0a04a661fde731a212b0489fe211566ff5ca8 (diff)
downloadbitcoin-8e2ecfe2496d8a015f3ee8723025a438feffbd28.tar.xz
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.
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);
}