Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 5,187 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() { | void UnloadBlockIndex(CTxMemPool *mempool) { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
g_chainman.Unload(); | g_chainman.Unload(); | ||||
pindexBestInvalid = nullptr; | pindexBestInvalid = nullptr; | ||||
pindexBestParked = nullptr; | pindexBestParked = nullptr; | ||||
pindexBestHeader = nullptr; | pindexBestHeader = nullptr; | ||||
pindexBestForkTip = nullptr; | pindexBestForkTip = nullptr; | ||||
pindexBestForkBase = nullptr; | pindexBestForkBase = nullptr; | ||||
ResetASERTAnchorBlockCache(); | ResetASERTAnchorBlockCache(); | ||||
g_mempool.clear(); | if (mempool) { | ||||
mempool->clear(); | |||||
} | |||||
vinfoBlockFile.clear(); | vinfoBlockFile.clear(); | ||||
nLastBlockFile = 0; | nLastBlockFile = 0; | ||||
setDirtyBlockIndex.clear(); | setDirtyBlockIndex.clear(); | ||||
setDirtyFileInfo.clear(); | setDirtyFileInfo.clear(); | ||||
fHavePruned = false; | fHavePruned = false; | ||||
} | } | ||||
bool ChainstateManager::LoadBlockIndex(const Consensus::Params ¶ms) { | bool ChainstateManager::LoadBlockIndex(const Consensus::Params ¶ms) { | ||||
▲ Show 20 Lines • Show All 945 Lines • Show Last 20 Lines |