diff --git a/blockstore/autobatch.go b/blockstore/autobatch.go index 53764d15cae..778995dbdce 100644 --- a/blockstore/autobatch.go +++ b/blockstore/autobatch.go @@ -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