diff --git a/blockstore/autobatch.go b/blockstore/autobatch.go index 6393b2e22f8..c2c28144652 100644 --- a/blockstore/autobatch.go +++ b/blockstore/autobatch.go @@ -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