MCPcopy Create free account
hub / github.com/ElementsProject/elements / UnloadBlockIndex

Function UnloadBlockIndex

src/validation.cpp:4536–4547  ·  view source on GitHub ↗

May NOT be used after any connections are up as much of the peer-processing logic assumes a consistent block index state

Source from the content-addressed store, hash-verified

4534// of the peer-processing logic assumes a consistent
4535// block index state
4536void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman)
4537{
4538 LOCK(cs_main);
4539 chainman.Unload();
4540 pindexBestHeader = nullptr;
4541 if (mempool) mempool->clear();
4542 g_versionbitscache.Clear();
4543 for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) {
4544 warningcache[b].clear();
4545 }
4546 fHavePruned = false;
4547}
4548
4549bool ChainstateManager::LoadBlockIndex()
4550{

Callers 3

~ChainstateManagerMethod · 0.85
~ChainTestingSetupMethod · 0.85
LoadChainstateFunction · 0.85

Calls 3

UnloadMethod · 0.45
clearMethod · 0.45
ClearMethod · 0.45

Tested by 1

~ChainTestingSetupMethod · 0.68