Unverified Commit 59805f03 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #5414 from ipfs/nit/no-caching-nil-repo

don't bother caching if we're using a nil repo
parents 1b4972b4 5bc843e5
......@@ -205,22 +205,24 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
opts.HasBloomFilterSize = 0
}
wbs, err := bstore.CachedBlockstore(ctx, bs, opts)
if err != nil {
return err
if !cfg.NilRepo {
bs, err = bstore.CachedBlockstore(ctx, bs, opts)
if err != nil {
return err
}
}
wbs = bstore.NewIdStore(wbs)
bs = bstore.NewIdStore(bs)
wbs = cidv0v1.NewBlockstore(wbs)
bs = cidv0v1.NewBlockstore(bs)
n.BaseBlocks = wbs
n.BaseBlocks = bs
n.GCLocker = bstore.NewGCLocker()
n.Blockstore = bstore.NewGCBlockstore(wbs, n.GCLocker)
n.Blockstore = bstore.NewGCBlockstore(bs, n.GCLocker)
if conf.Experimental.FilestoreEnabled || conf.Experimental.UrlstoreEnabled {
// hash security
n.Filestore = filestore.NewFilestore(wbs, n.Repo.FileManager())
n.Filestore = filestore.NewFilestore(bs, n.Repo.FileManager())
n.Blockstore = bstore.NewGCBlockstore(n.Filestore, n.GCLocker)
n.Blockstore = &verifbs.VerifBSGC{GCBlockstore: n.Blockstore}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment