|
@ -90,17 +90,17 @@ func (pvj *PrivValidatorJSON) Save() { |
|
|
|
|
|
|
|
|
func (pvj *PrivValidatorJSON) save() { |
|
|
func (pvj *PrivValidatorJSON) save() { |
|
|
if pvj.filePath == "" { |
|
|
if pvj.filePath == "" { |
|
|
cmn.PanicSanity("Cannot save PrivValidator: filePath not set") |
|
|
|
|
|
|
|
|
panic("Cannot save PrivValidator: filePath not set") |
|
|
} |
|
|
} |
|
|
jsonBytes, err := json.Marshal(pvj) |
|
|
jsonBytes, err := json.Marshal(pvj) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
// ; BOOM!!!
|
|
|
// ; BOOM!!!
|
|
|
cmn.PanicCrisis(err) |
|
|
|
|
|
|
|
|
panic(err) |
|
|
} |
|
|
} |
|
|
err = cmn.WriteFileAtomic(pvj.filePath, jsonBytes, 0600) |
|
|
err = cmn.WriteFileAtomic(pvj.filePath, jsonBytes, 0600) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
// ; BOOM!!!
|
|
|
// ; BOOM!!!
|
|
|
cmn.PanicCrisis(err) |
|
|
|
|
|
|
|
|
panic(err) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|