Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 5,194 Lines • ▼ Show 20 Lines | void CChainState::UnloadBlockIndex() { | ||||
// Do not point to CBlockIndex that will be free'd | // Do not point to CBlockIndex that will be free'd | ||||
m_finalizedBlockIndex = nullptr; | m_finalizedBlockIndex = nullptr; | ||||
} | } | ||||
// May NOT be used after any connections are up as much | // May NOT be used after any connections are up as much | ||||
// of the peer-processing logic assumes a consistent | // of the peer-processing logic assumes a consistent | ||||
// block index state | // block index state | ||||
void UnloadBlockIndex(CTxMemPool *mempool) { | void UnloadBlockIndex(CTxMemPool *mempool, ChainstateManager &chainman) { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
g_chainman.Unload(); | chainman.Unload(); | ||||
pindexBestInvalid = nullptr; | pindexBestInvalid = nullptr; | ||||
pindexBestParked = nullptr; | pindexBestParked = nullptr; | ||||
pindexBestHeader = nullptr; | pindexBestHeader = nullptr; | ||||
pindexBestForkTip = nullptr; | pindexBestForkTip = nullptr; | ||||
pindexBestForkBase = nullptr; | pindexBestForkBase = nullptr; | ||||
ResetASERTAnchorBlockCache(); | ResetASERTAnchorBlockCache(); | ||||
if (mempool) { | if (mempool) { | ||||
mempool->clear(); | mempool->clear(); | ||||
▲ Show 20 Lines • Show All 940 Lines • Show Last 20 Lines |