core/blockchain: Change iterator in procFutureBlocks to use lru.Peek instead of Get

This commit is contained in:
Martin Holst Swende 2017-02-07 13:20:04 +01:00
parent fa99986143
commit cb3587f377

View file

@ -592,7 +592,7 @@ func (bc *BlockChain) Stop() {
func (self *BlockChain) procFutureBlocks() {
blocks := make([]*types.Block, 0, self.futureBlocks.Len())
for _, hash := range self.futureBlocks.Keys() {
if block, exist := self.futureBlocks.Get(hash); exist {
if block, exist := self.futureBlocks.Peek(hash); exist {
blocks = append(blocks, block.(*types.Block))
}
}