core: block cache Has method thread safe

pull/1044/head
obscuren 9 years ago
parent 87a05c8f38
commit 8dac28f2e3
  1. 3
      core/block_cache.go

@ -85,6 +85,9 @@ func (bc *BlockCache) Get(hash common.Hash) *types.Block {
} }
func (bc *BlockCache) Has(hash common.Hash) bool { func (bc *BlockCache) Has(hash common.Hash) bool {
bc.mu.RLock()
defer bc.mu.RUnlock()
_, ok := bc.blocks[hash] _, ok := bc.blocks[hash]
return ok return ok
} }

Loading…
Cancel
Save