mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-23 01:00:31 +00:00
pretty print addrbook json
This commit is contained in:
@@ -305,11 +305,11 @@ func (a *AddrBook) saveToFile(filePath string) {
|
||||
log.Error("Error opening file: ", filePath, err)
|
||||
return
|
||||
}
|
||||
enc := json.NewEncoder(w)
|
||||
defer w.Close()
|
||||
err = enc.Encode(&aJSON)
|
||||
jsonBytes, err := json.MarshalIndent(aJSON, "", "\t")
|
||||
_, err = w.Write(jsonBytes)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Error("Failed to save AddrBook to file %v: %v", filePath, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user