From 4301ae2d349e4daf4844d18989fcb713ec53a473 Mon Sep 17 00:00:00 2001 From: Anshal Shukla <53994948+anshalshukla@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:47:57 +0530 Subject: [PATCH] handle: start after data dir deletion (#33) --- privval/file.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/privval/file.go b/privval/file.go index 01f78baecf9..2a232930df6 100644 --- a/privval/file.go +++ b/privval/file.go @@ -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)