Rollback mailserver DataDir to previous leveldb data directory
This commit is contained in:
parent
7325b38ef9
commit
e9da21cf87
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue