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.
This commit is contained in:
Daniel Krawisz 2015-05-31 16:47:58 -05:00
parent 506fc9fb94
commit 2dc8687728

View file

@ -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
}