Skip to content

Commit

Permalink
handle: start after data dir deletion (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshalshukla committed Apr 5, 2024
1 parent 2f132b9 commit 4301ae2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions privval/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ func loadFilePV(keyFilePath, stateFilePath string, loadState bool) *FilePV {
func LoadOrGenFilePV(keyFilePath, stateFilePath string) *FilePV {
var pv *FilePV
if cmn.FileExists(keyFilePath) {
if !cmn.FileExists(stateFilePath) {
pv = LoadFilePVEmptyState(keyFilePath, stateFilePath)
pv.Save()
}
pv = LoadFilePV(keyFilePath, stateFilePath)
} else {
pv = GenFilePV(keyFilePath, stateFilePath)
Expand Down

0 comments on commit 4301ae2

Please sign in to comment.