| 4066 | } |
| 4067 | |
| 4068 | void 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 | |
| 4102 | bool LoadBlockIndex(bool* fRebuildRequired) |
| 4103 | { |