Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 6,289 Lines • ▼ Show 20 Lines | bool ChainstateManager::PopulateAndValidateSnapshot( | ||||
CCoinsStats stats; | CCoinsStats stats; | ||||
auto breakpoint_fnc = [] { /* TODO insert breakpoint here? */ }; | auto breakpoint_fnc = [] { /* TODO insert breakpoint here? */ }; | ||||
// As above, okay to immediately release cs_main here since no other context | // As above, okay to immediately release cs_main here since no other context | ||||
// knows about the snapshot_chainstate. | // knows about the snapshot_chainstate. | ||||
CCoinsViewDB *snapshot_coinsdb = | CCoinsViewDB *snapshot_coinsdb = | ||||
WITH_LOCK(::cs_main, return &snapshot_chainstate.CoinsDB()); | WITH_LOCK(::cs_main, return &snapshot_chainstate.CoinsDB()); | ||||
if (!GetUTXOStats(snapshot_coinsdb, stats, | if (!GetUTXOStats(snapshot_coinsdb, | ||||
WITH_LOCK(::cs_main, return std::ref(m_blockman)), stats, | |||||
CoinStatsHashType::HASH_SERIALIZED, breakpoint_fnc)) { | CoinStatsHashType::HASH_SERIALIZED, breakpoint_fnc)) { | ||||
LogPrintf("[snapshot] failed to generate coins stats\n"); | LogPrintf("[snapshot] failed to generate coins stats\n"); | ||||
return false; | return false; | ||||
} | } | ||||
// Assert that the deserialized chainstate contents match the expected | // Assert that the deserialized chainstate contents match the expected | ||||
// assumeutxo value. | // assumeutxo value. | ||||
if (AssumeutxoHash{stats.hashSerialized} != au_data.hash_serialized) { | if (AssumeutxoHash{stats.hashSerialized} != au_data.hash_serialized) { | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |