Skip to content

Commit

Permalink
Merge pull request #7939 from filecoin-project/asr/migration-autobatch
Browse files Browse the repository at this point in the history
fix: blockstore: Add missing locks to autobatch::Get()
  • Loading branch information
arajasek authored Jan 12, 2022
2 parents b161f56 + efe9ec4 commit ae12c70
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 @@ -162,6 +162,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 ae12c70

Please sign in to comment.