fixes from Bucky's and Emmanuel's reviews

This commit is contained in:
Anton Kaliaev
2017-10-30 11:12:01 -05:00
parent 6d18e2f447
commit 61d76a273f
10 changed files with 76 additions and 56 deletions

View File

@ -6,8 +6,11 @@ import (
"fmt"
"hash/crc32"
"io"
"path/filepath"
"time"
"github.com/pkg/errors"
wire "github.com/tendermint/go-wire"
"github.com/tendermint/tendermint/types"
auto "github.com/tendermint/tmlibs/autofile"
@ -70,6 +73,11 @@ type baseWAL struct {
}
func NewWAL(walFile string, light bool) (*baseWAL, error) {
err := cmn.EnsureDir(filepath.Dir(walFile), 0700)
if err != nil {
return nil, errors.Wrap(err, "failed to ensure WAL directory is in place")
}
group, err := auto.OpenGroup(walFile)
if err != nil {
return nil, err