Merge pull request #21677 from aaronlehmann/layer-store-locking
Fix layer store Get locking
This commit is contained in:
commit
156c5db889
1 changed files with 4 additions and 1 deletions
|
@ -334,7 +334,10 @@ func (ls *layerStore) get(l ChainID) *roLayer {
|
|||
}
|
||||
|
||||
func (ls *layerStore) Get(l ChainID) (Layer, error) {
|
||||
layer := ls.get(l)
|
||||
ls.layerL.Lock()
|
||||
defer ls.layerL.Unlock()
|
||||
|
||||
layer := ls.getWithoutLock(l)
|
||||
if layer == nil {
|
||||
return nil, ErrLayerDoesNotExist
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue