aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-07-10 17:35:22 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-07-11 16:44:53 +0200
commitd4d3fbd828a477e8459169a097d5f1bfb69c2781 (patch)
treeaf5ca954ae1c347891905b459e9d30e858997f2c /src/main.cpp
parentd3165ed35adde59bdfbe72928b51a039202fa21e (diff)
Do not flush the cache after every block outside of IBD
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a9c080ffae..80a6956d19 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1915,7 +1915,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C
// Update the on-disk chain state.
bool static WriteChainState(CValidationState &state) {
static int64_t nLastWrite = 0;
- if (!IsInitialBlockDownload() || pcoinsTip->GetCacheSize() > nCoinCacheSize || GetTimeMicros() > nLastWrite + 600*1000000) {
+ if (pcoinsTip->GetCacheSize() > nCoinCacheSize || (!IsInitialBlockDownload() && GetTimeMicros() > nLastWrite + 600*1000000)) {
// Typical CCoins structures on disk are around 100 bytes in size.
// Pushing a new one to the database can cause it to be written
// twice (once in the log, and once in the tables). This is already