diff --git a/core/node/core.go b/core/node/core.go index 9a2035a4c8c7..b96c4fe0b67c 100644 --- a/core/node/core.go +++ b/core/node/core.go @@ -146,7 +146,7 @@ func Dag(bs blockservice.BlockService) format.DAGService { } // Files loads persisted MFS root -func Files(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, dag format.DAGService) (*mfs.Root, error) { +func Files(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, dag format.DAGService, bs blockstore.Blockstore) (*mfs.Root, error) { dsk := datastore.NewKey("/local/filesroot") pf := func(ctx context.Context, c cid.Cid) error { rootDS := repo.Datastore() @@ -180,8 +180,12 @@ func Files(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, dag format. return nil, err } - rnd, err := dag.Get(ctx, c) + offineDag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) + rnd, err := offineDag.Get(ctx, c) if err != nil { + if err == format.ErrNotFound { + return nil, fmt.Errorf("filesystem root not found in local repo: %s", c) + } return nil, fmt.Errorf("error loading filesroot from DAG: %s", err) }