blocks[block.Hash()] = block
}
- cache := newBlockCache(func(hash *bc.Hash) (*types.Block, error) {
+ cache := newBlockCache(func(hash *bc.Hash, height uint64) (*types.Block, error) {
return blocks[*hash], nil
})
for i := 0; i < maxCachedBlocks+10; i++ {
block := newBlock(uint64(i))
hash := block.Hash()
- cache.lookup(&hash)
+ cache.lookup(&hash, block.Height)
}
for i := 0; i < 10; i++ {