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

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
}