Skip to content

Commit

Permalink
Merge pull request #4922 from filecoin-project/raulk/fix-fresh-blocks…
Browse files Browse the repository at this point in the history
…tore

fix blockstore directory not created automatically.
  • Loading branch information
magik6k authored Nov 19, 2020
2 parents 8802040 + 55061ae commit 648f02c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions node/repo/fsrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ func (fsr *fsLockedRepo) Blockstore(domain BlockstoreDomain) (blockstore.Blockst
path := fsr.join(filepath.Join(fsDatastore, "chain"))
readonly := fsr.readonly

if err := os.MkdirAll(path, 0755); err != nil {
fsr.bsErr = err
return
}

opts, err := BadgerBlockstoreOptions(domain, path, readonly)
if err != nil {
fsr.bsErr = err
Expand All @@ -317,6 +322,7 @@ func (fsr *fsLockedRepo) Blockstore(domain BlockstoreDomain) (blockstore.Blockst
bs, err := badgerbs.Open(opts)
if err != nil {
fsr.bsErr = err
return
}
fsr.bs = lblockstore.WrapIDStore(bs)
})
Expand Down

0 comments on commit 648f02c

Please sign in to comment.