mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Log an error when json encoding of peers.json fails.
This commit is contained in:
parent
5966a5230d
commit
79fe7aadd6
@ -481,7 +481,10 @@ func (a *AddrManager) savePeers() {
|
||||
}
|
||||
enc := json.NewEncoder(w)
|
||||
defer w.Close()
|
||||
enc.Encode(&sam)
|
||||
if err := enc.Encode(&sam); err != nil {
|
||||
amgrLog.Errorf("Failed to encode %s: %v", filePath, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// loadPeers loads the known address from the saved file. If empty, missing, or
|
||||
|
Loading…
x
Reference in New Issue
Block a user