Commit e85a39c6 authored by Jakub Sztandera's avatar Jakub Sztandera

core: do not run bloom filter if in a temoporary node mode

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent 61a3d127
......@@ -229,7 +229,8 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
// Start assembling node config
ncfg := &core.BuildCfg{
Repo: repo,
Repo: repo,
Permament: true,
}
offline, _, _ := req.Option(offlineKwd).Bool()
ncfg.Online = !offline
......
......@@ -27,6 +27,10 @@ type BuildCfg struct {
// If online is set, the node will have networking enabled
Online bool
// If permament then node should run more expensive processes
// that will improve performance in long run
Permament bool
// If NilRepo is set, a repo backed by a nil datastore will be constructed
NilRepo bool
......@@ -131,7 +135,12 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
var err error
bs := bstore.NewBlockstore(n.Repo.Datastore())
n.Blockstore, err = bstore.CachedBlockstore(bs, ctx, bstore.DefaultCacheOpts())
opts := bstore.DefaultCacheOpts()
if !cfg.Permament {
opts.HasBloomFilterSize = 0
}
n.Blockstore, err = bstore.CachedBlockstore(bs, ctx, opts)
if err != nil {
return err
}
......
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