From 999b9e081d04a3af1c3427c97b3b7ef08d0bb56a Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Mon, 2 Aug 2021 14:42:09 -0700 Subject: [PATCH] add constructor that doesnt mess with datastore keys This commit was moved from ipfs/go-ipfs-blockstore@c56038684c45ce32184d5c1441d7e8b1d6bfa512 --- blockstore/blockstore.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/blockstore/blockstore.go b/blockstore/blockstore.go index 6625a3411..0f9686683 100644 --- a/blockstore/blockstore.go +++ b/blockstore/blockstore.go @@ -121,6 +121,16 @@ func NewBlockstore(d ds.Batching) Blockstore { } } +// NewBlockstoreNoPrefix returns a default Blockstore implementation +// using the provided datastore.Batching backend. +// This constructor does not modify input keys in any way +func NewBlockstoreNoPrefix(d ds.Batching) Blockstore { + return &blockstore{ + datastore: d, + rehash: uatomic.NewBool(false), + } +} + type blockstore struct { datastore ds.Batching