From 99d0d5019b4eba30e86e6a5762719a25716af811 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Wed, 12 Jan 2022 17:22:54 -0500 Subject: [PATCH] Add missing locks to Get() --- blockstore/autobatch.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blockstore/autobatch.go b/blockstore/autobatch.go index 6393b2e22..c2c281446 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