Merge pull request #21677 from aaronlehmann/layer-store-locking

Fix layer store Get locking
This commit is contained in:
Antonio Murdaca 2016-03-31 11:35:02 +02:00
commit 156c5db889
1 changed files with 4 additions and 1 deletions

View File

@ -334,7 +334,10 @@ func (ls *layerStore) get(l ChainID) *roLayer {
} }
func (ls *layerStore) Get(l ChainID) (Layer, error) { 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 { if layer == nil {
return nil, ErrLayerDoesNotExist return nil, ErrLayerDoesNotExist
} }