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

Fix layer store Get locking
Upstream-commit: 156c5db889b29e28e0176019b1996af4a5465a77
Component: engine
This commit is contained in:
Antonio Murdaca
2016-03-31 11:35:02 +02:00
+4 -1
View File
@@ -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
}