From 5f9214c8db55d92b36a16971d47854e7123f78e7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 1 Feb 2020 17:01:48 -0800 Subject: [PATCH] fix: return raw block CIDs instead of V0 CIDs from AllKeysChan V0 CIDs are always "dag-pb". Using the "raw" codec indicates that these blocks are just raw data. --- blockstore.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/blockstore.go b/blockstore.go index a7e8b5d..e815642 100644 --- a/blockstore.go +++ b/blockstore.go @@ -224,10 +224,7 @@ func (bs *blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) { log.Warningf("error parsing key from binary: %s", err) continue } - k, err := cid.Cast(bk) - if err != nil { - log.Warningf("failed to cast cid: %s", err) - } + k := cid.NewCidV1(cid.Raw, bk) select { case <-ctx.Done(): return -- GitLab