Init last commit cache

pull/1235/head
Rongjian Lan 5 years ago
parent cb7b5e3343
commit a61a749d00
  1. 3
      core/blockchain.go

@ -65,6 +65,7 @@ const (
badBlockLimit = 10
triesInMemory = 128
shardCacheLimit = 2
commitsCacheLimit = 10
epochCacheLimit = 10
// BlocksPerEpoch is the number of blocks in one epoch
@ -168,6 +169,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
futureBlocks, _ := lru.New(maxFutureBlocks)
badBlocks, _ := lru.New(badBlockLimit)
shardCache, _ := lru.New(shardCacheLimit)
commitsCache, _ := lru.New(commitsCacheLimit)
epochCache, _ := lru.New(epochCacheLimit)
bc := &BlockChain{
@ -184,6 +186,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
blockCache: blockCache,
futureBlocks: futureBlocks,
shardStateCache: shardCache,
lastCommitsCache: commitsCache,
epochCache: epochCache,
engine: engine,
vmConfig: vmConfig,

Loading…
Cancel
Save