mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
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.
This commit is contained in:
parent
d2d0a04a66
commit
8e2ecfe249
2 changed files with 16 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue