namecache: initialize blockstore

License: MIT
Signed-off-by: vyzo <vyzo@hackzen.org>
This commit is contained in:
vyzo 2017-12-08 17:16:19 +02:00 committed by Łukasz Magiera
parent e76e4c58a0
commit 795d9e8d78
2 changed files with 3 additions and 2 deletions

View File

@ -590,7 +590,7 @@ func (n *IpfsNode) startOnlineServicesWithHost(ctx context.Context, routingOptio
// setup name system
n.Namesys = namesys.NewNameSystem(n.Routing, n.Repo.Datastore(), size)
n.Namecache = namecache.NewNameCache(ctx, n.Namesys, n.Pinning, n.DAG)
n.Namecache = namecache.NewNameCache(ctx, n.Namesys, n.Pinning, n.DAG, n.Blockstore)
// setup ipns republishing
return n.setupIpnsRepublisher()

View File

@ -48,12 +48,13 @@ type nameCache struct {
mx sync.Mutex
}
func NewNameCache(ctx context.Context, nsys namesys.NameSystem, pinning pin.Pinner, dag ipld.DAGService) NameCache {
func NewNameCache(ctx context.Context, nsys namesys.NameSystem, pinning pin.Pinner, dag ipld.DAGService, bstore bstore.GCBlockstore) NameCache {
return &nameCache{
ctx: ctx,
nsys: nsys,
pinning: pinning,
dag: dag,
bstore: bstore,
follows: make(map[string]func()),
}
}