Merge pull request #7025 from lanzafame/fix/need-empty-storage-json

fix: init restore adds empty storage.json
This commit is contained in:
Łukasz Magiera 2021-08-27 12:29:27 +02:00 committed by GitHub
commit a63f5c8bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,6 +223,12 @@ func restore(ctx context.Context, cctx *cli.Context, targetPath string, strConfi
}
} else {
log.Warn("--storage-config NOT SET. NO SECTOR PATHS WILL BE CONFIGURED")
// setting empty config to allow miner to be started
if err := lr.SetStorage(func(sc *stores.StorageConfig) {
sc.StoragePaths = append(sc.StoragePaths, stores.LocalPath{})
}); err != nil {
return xerrors.Errorf("set storage config: %w", err)
}
}
log.Info("Restoring metadata backup")