mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 06:54:41 +00:00
Atomic write to addrbook and privvalidator
This commit is contained in:
@@ -99,8 +99,9 @@ func (privVal *PrivValidator) Save() {
|
||||
|
||||
func (privVal *PrivValidator) save() {
|
||||
jsonBytes := binary.JSONBytes(privVal)
|
||||
err := ioutil.WriteFile(privVal.filename, jsonBytes, 0700)
|
||||
err := AtomicWriteFile(privVal.filename, jsonBytes)
|
||||
if err != nil {
|
||||
// `@; BOOM!!!
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user