Rollback mailserver DataDir to previous leveldb data directory

This commit is contained in:
Adrià Cidre 2018-05-18 16:47:50 +02:00 committed by Dmitry Shulyak
parent 7325b38ef9
commit e9da21cf87
1 changed files with 1 additions and 3 deletions

View File

@ -19,7 +19,6 @@ package mailserver
import ( import (
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"path/filepath"
"sync" "sync"
"time" "time"
@ -74,12 +73,11 @@ func (s *WMailServer) Init(shh *whisper.Whisper, config *params.WhisperConfig) e
return fmt.Errorf("data directory not provided") return fmt.Errorf("data directory not provided")
} }
path := filepath.Join(config.DataDir, "mailserver", "data")
if len(config.Password) == 0 { if len(config.Password) == 0 {
return fmt.Errorf("password is not specified") return fmt.Errorf("password is not specified")
} }
s.db, err = leveldb.OpenFile(path, nil) s.db, err = leveldb.OpenFile(config.DataDir, nil)
if err != nil { if err != nil {
return fmt.Errorf("open DB: %s", err) return fmt.Errorf("open DB: %s", err)
} }