From 44aafcf742a5de1652f99c1235b5baa36f7f6f43 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sat, 12 Oct 2013 11:45:38 -0500 Subject: [PATCH] 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. --- addrmanager.go | 1 + 1 file changed, 1 insertion(+) diff --git a/addrmanager.go b/addrmanager.go index f8bbcbb1..03dfc9f7 100644 --- a/addrmanager.go +++ b/addrmanager.go @@ -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()