Commit 8dac28f2 authored by obscuren's avatar obscuren

core: block cache Has method thread safe

parent 87a05c8f
......@@ -85,6 +85,9 @@ func (bc *BlockCache) Get(hash common.Hash) *types.Block {
}
func (bc *BlockCache) Has(hash common.Hash) bool {
bc.mu.RLock()
defer bc.mu.RUnlock()
_, ok := bc.blocks[hash]
return ok
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment