diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-11-08 14:17:37 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-11-08 14:17:37 -0800 |
commit | 16d9d61f99c2e081585e6634d25da3523804eabf (patch) | |
tree | 5037a2b474e9f6b55630d9ccee68478e619421a5 /src/main.cpp | |
parent | 86406daeca0390b13457cc4f8d5f24fa5bf54557 (diff) | |
parent | 1c83b0a3771bc601fdc75588f2cd45318b19c526 (diff) |
Merge pull request #1981 from sipa/caches
Cache size optimizations
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 43bd5dd472..a08e393caa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,6 +41,7 @@ CBlockIndex* pindexBest = NULL; set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid; // may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed int64 nTimeBestReceived = 0; bool fImporting = false; +unsigned int nCoinCacheSize = 5000; CMedianFilter<int> cPeerBlockCounts(5, 0); // Amount of blocks that other nodes claim to have @@ -1735,7 +1736,7 @@ bool SetBestChain(CBlockIndex* pindexNew) // Make sure it's successfully written to disk before changing memory structure bool fIsInitialDownload = IsInitialBlockDownload(); - if (!fIsInitialDownload || view.GetCacheSize()>5000) { + if (!fIsInitialDownload || view.GetCacheSize() > nCoinCacheSize) { FlushBlockFile(); pblocktree->Sync(); if (!view.Flush()) |