Merge pull request #823 from filecoin-project/fix/badger-read-only

make badger readonly when initializing storage miner from sector set
This commit is contained in:
Łukasz Magiera 2019-12-09 23:09:40 +01:00 committed by GitHub
commit 3f021a0aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -179,7 +179,7 @@ var aggregateSectorDirsCmd = &cli.Command{
return err
}
if err := os.MkdirAll(cctx.String("dest"), 0755); err != nil {
if err := os.MkdirAll(destdir, 0755); err != nil {
return err
}

View File

@ -153,7 +153,9 @@ var initCmd = &cli.Command{
return err
}
oldmds, err := badger.NewDatastore(filepath.Join(pssb, "badger"), nil)
bopts := badger.DefaultOptions
bopts.ReadOnly = true
oldmds, err := badger.NewDatastore(filepath.Join(pssb, "badger"), &bopts)
if err != nil {
return err
}