core: fixed tests

This commit is contained in:
Jeffrey Wilcke
2015-06-27 13:57:56 +02:00
parent aba901e13c
commit e349fac97d
3 changed files with 2 additions and 2 deletions

View File

@ -264,6 +264,7 @@ func (bc *ChainManager) setLastState() {
func (bc *ChainManager) makeCache() {
bc.cache, _ = lru.New(blockCacheLimit)
// load in last `blockCacheLimit` - 1 blocks. Last block is the current.
bc.cache.Add(bc.genesisBlock.Hash(), bc.genesisBlock)
for _, block := range bc.GetBlocksFromHash(bc.currentBlock.Hash(), blockCacheLimit) {
bc.cache.Add(block.Hash(), block)
}