From b19ccd82854b112a510e240cbce11bec5eb72098 Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Wed, 13 Aug 2025 12:24:48 -0700 Subject: [PATCH] carstore/sqlite: use cidv1 when retrieving blocks --- carstore/sqlite_store.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/carstore/sqlite_store.go b/carstore/sqlite_store.go index d04fa6dd..5fbf4bad 100644 --- a/carstore/sqlite_store.go +++ b/carstore/sqlite_store.go @@ -6,12 +6,13 @@ import ( "database/sql" "errors" "fmt" - "go.opentelemetry.io/otel/attribute" "io" "log/slog" "os" "path/filepath" + "go.opentelemetry.io/otel/attribute" + "github.com/bluesky-social/indigo/models" blockformat "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" @@ -470,7 +471,11 @@ func (sqs *SQLiteStore) getBlock(ctx context.Context, user models.Uid, bcid cid. if err != nil { return nil, fmt.Errorf("getb bad scan, %w", err) } - return blocks.NewBlock(blockb), nil + blk, err := blocks.NewBlockWithCid(blockb, bcid) + if err != nil { + return nil, fmt.Errorf("getb bad block, %w", err) + } + return blk, nil } return nil, ErrNothingThere } -- 2.51.2