diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-03-09 12:43:21 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-03-09 12:51:07 +0100 |
| commit | cdae53e456ad35216e33a90f1681aade546cc431 (patch) | |
| tree | d21c3163a804c7542241c089075586acd16c218e /src/main.cpp | |
| parent | Merge pull request #5442 (diff) | |
| parent | Reinitialize state in between individual unit tests. (diff) | |
| download | discoin-cdae53e456ad35216e33a90f1681aade546cc431.tar.xz discoin-cdae53e456ad35216e33a90f1681aade546cc431.zip | |
Merge pull request #5852
51598b2 Reinitialize state in between individual unit tests. (Pieter Wuille)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index a2043dd9c..0b36b5f21 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -54,7 +54,6 @@ bool fTxIndex = false; bool fIsBareMultisigStd = true; unsigned int nCoinCacheSize = 5000; - /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ CFeeRate minRelayTxFee = CFeeRate(1000); @@ -3085,10 +3084,31 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth void UnloadBlockIndex() { - mapBlockIndex.clear(); + LOCK(cs_main); setBlockIndexCandidates.clear(); chainActive.SetTip(NULL); pindexBestInvalid = NULL; + pindexBestHeader = NULL; + mempool.clear(); + mapOrphanTransactions.clear(); + mapOrphanTransactionsByPrev.clear(); + nSyncStarted = 0; + mapBlocksUnlinked.clear(); + vinfoBlockFile.clear(); + nLastBlockFile = 0; + nBlockSequenceId = 1; + mapBlockSource.clear(); + mapBlocksInFlight.clear(); + nQueuedValidatedHeaders = 0; + nPreferredDownload = 0; + setDirtyBlockIndex.clear(); + setDirtyFileInfo.clear(); + mapNodeState.clear(); + + BOOST_FOREACH(BlockMap::value_type& entry, mapBlockIndex) { + delete entry.second; + } + mapBlockIndex.clear(); } bool LoadBlockIndex() |