diff --git a/addrmgr/knownaddress_test.go b/addrmgr/knownaddress_test.go index 05609ec9..79503df3 100644 --- a/addrmgr/knownaddress_test.go +++ b/addrmgr/knownaddress_test.go @@ -61,7 +61,7 @@ func TestIsBad(t *testing.T) { secondsOld := time.Now().Add(-2 * time.Second) minutesOld := time.Now().Add(-27 * time.Minute) hoursOld := time.Now().Add(-5 * time.Hour) - zeroTime, _ := time.Parse("Jan 1, 1970 at 0:00am (GMT)", "Jan 1, 1970 at 0:00am (GMT)") + zeroTime := time.Time{} futureNa := &wire.NetAddress{Timestamp: future} minutesOldNa := &wire.NetAddress{Timestamp: minutesOld} diff --git a/upgrade.go b/upgrade.go index 78bc6f2d..da9c27b7 100644 --- a/upgrade.go +++ b/upgrade.go @@ -13,6 +13,9 @@ import ( // dirEmpty returns whether or not the specified directory path is empty. func dirEmpty(dirPath string) (bool, error) { f, err := os.Open(dirPath) + if err != nil { + return false, err + } defer f.Close() // Read the names of a max of one entry from the directory. When the