MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / UnloadBlockIndex

Function UnloadBlockIndex

src/main.cpp:4068–4100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4066}
4067
4068void UnloadBlockIndex()
4069{
4070 LOCK(cs_main);
4071 setBlockIndexCandidates.clear();
4072 chainActive.SetTip(NULL);
4073 pindexBestInvalid = NULL;
4074 pindexBestHeader = NULL;
4075 mempool.clear();
4076 mapOrphanTransactions.clear();
4077 mapOrphanTransactionsByPrev.clear();
4078 nSyncStarted = 0;
4079 mapBlocksUnlinked.clear();
4080 vinfoBlockFile.clear();
4081 nLastBlockFile = 0;
4082 nBlockSequenceId = 1;
4083 blocksInFlight.clear();
4084 nQueuedValidatedHeaders = 0;
4085 nPreferredDownload = 0;
4086 setDirtyBlockIndex.clear();
4087 setDirtyFileInfo.clear();
4088 NodeStatePtr::clear();
4089 recentRejects.reset(NULL);
4090 versionbitscache.Clear();
4091 for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) {
4092 warningcache[b].clear();
4093 }
4094
4095 BOOST_FOREACH(BlockMap::value_type& entry, mapBlockIndex) {
4096 delete entry.second;
4097 }
4098 mapBlockIndex.clear();
4099 fHavePruned = false;
4100}
4101
4102bool LoadBlockIndex(bool* fRebuildRequired)
4103{

Callers 2

AppInit2Function · 0.85
~TestingSetupMethod · 0.85

Calls 4

SetTipMethod · 0.80
resetMethod · 0.80
clearMethod · 0.45
ClearMethod · 0.45

Tested by 1

~TestingSetupMethod · 0.68