Return on file error in address manager save.

This commit modifies the address manager save code to exit when there is
an error creating the file used to store addresses.  Previously the error
was only logged leaving the invalid file handle to be used later.
This commit is contained in:
Dave Collins 2013-10-12 11:45:38 -05:00
parent 6212a7daff
commit 44aafcf742

View file

@ -466,6 +466,7 @@ func (a *AddrManager) savePeers() {
w, err := os.Create(filePath)
if err != nil {
log.Error("Error opening file: ", filePath, err)
return
}
enc := json.NewEncoder(w)
defer w.Close()