From 888e165dd1d17c5a7a975dec33491011114cea55 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 1 Mar 2018 18:21:36 +0800 Subject: [PATCH] core: flush trie db if memory data size or processing time exceeds the limit --- core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index 4ae0e4f4ec..9b79d23ed5 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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