diff --git a/ethereum.go b/ethereum.go index c906a6954f7f8d3af338e4c1547f6ee60ff3c74a..b9174eaf8fbfeafbbb90f5a1c6bee799a721812f 100644 --- a/ethereum.go +++ b/ethereum.go @@ -350,7 +350,7 @@ func (s *Ethereum) WaitForShutdown() { func (s *Ethereum) upnpUpdateThread() { // Go off immediately to prevent code duplication, thereafter we renew // lease every 15 minutes. - timer := time.NewTimer(0 * time.Second) + timer := time.NewTimer(5 * time.Minute) lport, _ := strconv.ParseInt(s.Port, 10, 16) first := true out: diff --git a/natupnp.go b/natupnp.go index e4072d0ddb6d966cf9e99eeb7d8b6cbd8a8f38de..c7f9eeb622b30b3641cc51cbf3be29c63e73f21c 100644 --- a/natupnp.go +++ b/natupnp.go @@ -246,6 +246,10 @@ func soapRequest(url, function, message string) (r *http.Response, err error) { //fmt.Println(fullMessage) r, err = http.DefaultClient.Do(req) + if err != nil { + return + } + if r.Body != nil { defer r.Body.Close() }