diff --git a/blockstore/autobatch.go b/blockstore/autobatch.go index e9df6a3b3..53764d15c 100644 --- a/blockstore/autobatch.go +++ b/blockstore/autobatch.go @@ -152,8 +152,6 @@ func (bs *AutobatchBlockstore) Shutdown(ctx context.Context) error { } func (bs *AutobatchBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block, error) { - bs.stateLock.Lock() - defer bs.stateLock.Unlock() // may seem backward to check the backingBs first, but that is the likeliest case blk, err := bs.backingBs.Get(ctx, c) if err == nil { @@ -174,7 +172,7 @@ func (bs *AutobatchBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block, return v, nil } - return nil, ErrNotFound + return bs.Get(ctx, c) } func (bs *AutobatchBlockstore) DeleteBlock(context.Context, cid.Cid) error {