@@ -57,7 +57,7 @@ bool fPruneMode = false;
57
57
bool fIsBareMultisigStd = true ;
58
58
bool fCheckBlockIndex = false ;
59
59
bool fCheckpointsEnabled = true ;
60
- unsigned int nCoinCacheSize = 5000 ;
60
+ size_t nCoinCacheUsage = 5000 * 300 ;
61
61
uint64_t nPruneTarget = 0 ;
62
62
63
63
/* * Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */
@@ -1894,7 +1894,7 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
1894
1894
}
1895
1895
}
1896
1896
if ((mode == FLUSH_STATE_ALWAYS) ||
1897
- ((mode == FLUSH_STATE_PERIODIC || mode == FLUSH_STATE_IF_NEEDED) && pcoinsTip->GetCacheSize () > nCoinCacheSize ) ||
1897
+ ((mode == FLUSH_STATE_PERIODIC || mode == FLUSH_STATE_IF_NEEDED) && pcoinsTip->DynamicMemoryUsage () > nCoinCacheUsage ) ||
1898
1898
(mode == FLUSH_STATE_PERIODIC && GetTimeMicros () > nLastWrite + DATABASE_WRITE_INTERVAL * 1000000 ) ||
1899
1899
fFlushForPrune ) {
1900
1900
// Typical CCoins structures on disk are around 100 bytes in size.
@@ -3197,7 +3197,7 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth
3197
3197
}
3198
3198
}
3199
3199
// check level 3: check for inconsistencies during memory-only disconnect of tip blocks
3200
- if (nCheckLevel >= 3 && pindex == pindexState && (coins.GetCacheSize () + pcoinsTip->GetCacheSize ()) <= nCoinCacheSize ) {
3200
+ if (nCheckLevel >= 3 && pindex == pindexState && (coins.DynamicMemoryUsage () + pcoinsTip->DynamicMemoryUsage ()) <= nCoinCacheUsage ) {
3201
3201
bool fClean = true ;
3202
3202
if (!DisconnectBlock (block, state, pindex, coins, &fClean ))
3203
3203
return error (" VerifyDB(): *** irrecoverable inconsistency in block data at %d, hash=%s" , pindex->nHeight , pindex->GetBlockHash ().ToString ());
0 commit comments