From 879b4c0a2cbbef50d1a4ec1d3b82e80b7d92167b Mon Sep 17 00:00:00 2001 From: Alexander Simmerl Date: Tue, 6 Mar 2018 16:00:19 +0100 Subject: [PATCH] Use common method to determine file existence --- types/priv_validator/json.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/priv_validator/json.go b/types/priv_validator/json.go index 6e5261386..23c5d3e22 100644 --- a/types/priv_validator/json.go +++ b/types/priv_validator/json.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io/ioutil" - "os" crypto "github.com/tendermint/go-crypto" "github.com/tendermint/tendermint/types" @@ -144,7 +143,7 @@ func LoadPrivValidatorJSON(filePath string) *PrivValidatorJSON { // or else generates a new one and saves it to the filePath. func LoadOrGenPrivValidatorJSON(filePath string) *PrivValidatorJSON { var pvj *PrivValidatorJSON - if _, err := os.Stat(filePath); err == nil { + if cmn.FileExists(filePath) { pvj = LoadPrivValidatorJSON(filePath) } else { pvj = GenPrivValidatorJSON(filePath)