From 2dc868772839cb3af472d811c784b304e22aab19 Mon Sep 17 00:00:00 2001 From: Daniel Krawisz Date: Sun, 31 May 2015 16:47:58 -0500 Subject: [PATCH] Fix incorrect ip connection attempt logic. The comment says "only allow recent nodes (10mins) after we failed 30 times", but the server actually did the opposite and allowed only recent nodes before 30 failed connection attempts. This corrects the server's behavior. --- server.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server.go b/server.go index 474efca0..1d8aaa59 100644 --- a/server.go +++ b/server.go @@ -769,8 +769,7 @@ out: // only allow recent nodes (10mins) after we failed 30 // times - if time.Now().After(addr.LastAttempt().Add(10*time.Minute)) && - tries < 30 { + if tries < 30 && time.Now().Sub(addr.LastAttempt()) < 10*time.Minute { continue }