|
|
@ -1918,7 +1918,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C |
|
|
|
// Update the on-disk chain state.
|
|
|
|
// Update the on-disk chain state.
|
|
|
|
bool static WriteChainState(CValidationState &state) { |
|
|
|
bool static WriteChainState(CValidationState &state) { |
|
|
|
static int64_t nLastWrite = 0; |
|
|
|
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.
|
|
|
|
// Typical CCoins structures on disk are around 100 bytes in size.
|
|
|
|
// Pushing a new one to the database can cause it to be written
|
|
|
|
// 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
|
|
|
|
// twice (once in the log, and once in the tables). This is already
|
|
|
|