Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 733 Lines • ▼ Show 20 Lines | : m_dbview(GetDataDir() / ldb_name, cache_size_bytes, in_memory, | ||||
m_catcherview(&m_dbview) {} | m_catcherview(&m_dbview) {} | ||||
void CoinsViews::InitCache() { | void CoinsViews::InitCache() { | ||||
m_cacheview = std::make_unique<CCoinsViewCache>(&m_catcherview); | m_cacheview = std::make_unique<CCoinsViewCache>(&m_catcherview); | ||||
} | } | ||||
// NOTE: for now m_blockman is set to a global, but this will be changed | // NOTE: for now m_blockman is set to a global, but this will be changed | ||||
// in a future commit. | // in a future commit. | ||||
CChainState::CChainState() : m_blockman(g_blockman) {} | CChainState::CChainState(BlockHash from_snapshot_blockhash) | ||||
: m_blockman(g_blockman), | |||||
m_from_snapshot_blockhash(from_snapshot_blockhash) {} | |||||
void CChainState::InitCoinsDB(size_t cache_size_bytes, bool in_memory, | void CChainState::InitCoinsDB(size_t cache_size_bytes, bool in_memory, | ||||
bool should_wipe, std::string leveldb_name) { | bool should_wipe, std::string leveldb_name) { | ||||
if (!m_from_snapshot_blockhash.IsNull()) { | |||||
leveldb_name += "_" + m_from_snapshot_blockhash.ToString(); | |||||
} | |||||
m_coins_views = std::make_unique<CoinsViews>(leveldb_name, cache_size_bytes, | m_coins_views = std::make_unique<CoinsViews>(leveldb_name, cache_size_bytes, | ||||
in_memory, should_wipe); | in_memory, should_wipe); | ||||
} | } | ||||
void CChainState::InitCoinsCache() { | void CChainState::InitCoinsCache() { | ||||
assert(m_coins_views != nullptr); | assert(m_coins_views != nullptr); | ||||
m_coins_views->InitCache(); | m_coins_views->InitCache(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 5,045 Lines • Show Last 20 Lines |