core: block cache Has method thread safe

This commit is contained in:
obscuren
2015-05-19 21:50:56 +02:00
parent 87a05c8f38
commit 8dac28f2e3
+3
View File
@@ -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
}