fix blockstore directory not created automatically.

This commit is contained in:
Raúl Kripalani 2020-11-19 15:02:12 +00:00
parent dc3d17c9ea
commit 55061ae6fb

View File

@ -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
@ -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)
})