mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
whisper/mailserver : recover db file when openfile corrupted
This commit is contained in:
parent
3cf7d2e9a6
commit
da009b060d
1 changed files with 3 additions and 0 deletions
|
|
@ -70,6 +70,9 @@ func (s *WMailServer) Init(shh *whisper.Whisper, path string, password string, p
|
|||
}
|
||||
|
||||
s.db, err = leveldb.OpenFile(path, &opt.Options{OpenFilesCacheCapacity: 32})
|
||||
if _, iscorrupted := err.(*errors.ErrCorrupted); iscorrupted {
|
||||
db, err = leveldb.RecoverFile(path, nil)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("open DB file: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue