diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-15 09:13:49 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-15 09:14:33 +0200 |
commit | 2c0f019bfc0b9381b6dcad5960df48379b8dfe20 (patch) | |
tree | b9e5b30b1f123f974a004c5c4ad05881ab7195da /src/main.cpp | |
parent | 1f5e8fe804fdf4c717a309c068fc79a97fe72693 (diff) | |
parent | d4d3fbd828a477e8459169a097d5f1bfb69c2781 (diff) |
Merge pull request #4505
d4d3fbd Do not flush the cache after every block outside of IBD (Pieter Wuille)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4f6b442f3a..442feea471 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1918,7 +1918,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 |