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

Loading…
Cancel
Save