mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 04:57:17 +00:00
Merge pull request #1044 from obscuren/thread_safe_block_cache
core: block cache Has method thread safe
This commit is contained in:
commit
79042223dc
@ -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…
Reference in New Issue
Block a user