index: hold rlock in StorageList

This commit is contained in:
Łukasz Magiera 2020-04-29 14:13:21 +02:00
parent 5f1a27d52b
commit a0af4d4d2b

View File

@ -63,6 +63,9 @@ func NewIndex() *Index {
} }
func (i *Index) StorageList(ctx context.Context) (map[ID][]Decl, error) { func (i *Index) StorageList(ctx context.Context) (map[ID][]Decl, error) {
i.lk.RLock()
defer i.lk.RUnlock()
byID := map[ID]map[abi.SectorID]SectorFileType{} byID := map[ID]map[abi.SectorID]SectorFileType{}
for id := range i.stores { for id := range i.stores {