Add missing locks to Get()

This commit is contained in:
Aayush Rajasekaran 2022-01-12 17:22:54 -05:00
parent 3464dc2fdf
commit efe9ec4906

View File

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