Skip to content

Commit

Permalink
Add missing locks to Get()
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek authored and jennijuju committed Jan 14, 2022
1 parent 0ec8efd commit d457cb5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blockstore/autobatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d457cb5

Please sign in to comment.