mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
core: flush trie db if memory data size or processing time exceeds the limit
This commit is contained in:
parent
a1984ce727
commit
888e165dd1
1 changed files with 1 additions and 1 deletions
|
|
@ -932,7 +932,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
|
|||
}
|
||||
}
|
||||
// If optimum or critical limits reached, write to disk
|
||||
if chosen >= lastWrite+triesInMemory || size >= 2*limit || bc.gcproc >= 2*bc.cacheConfig.TrieTimeLimit {
|
||||
if chosen >= lastWrite+triesInMemory || size >= limit || bc.gcproc >= bc.cacheConfig.TrieTimeLimit {
|
||||
triedb.Commit(header.Root, true)
|
||||
lastWrite = chosen
|
||||
bc.gcproc = 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue