Add missing locks to Get()

This commit is contained in:
Aayush Rajasekaran 2022-01-12 17:22:54 -05:00 committed by Jennifer Wang
parent be09474615
commit 99d0d5019b

View File

@ -180,6 +180,8 @@ func (bs *AutobatchBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block,
return blk, err
}
bs.stateLock.Lock()
defer bs.stateLock.Unlock()
v, ok := bs.flushingBatch.blockMap[c]
if ok {
return v, nil