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:
parent
506fc9fb94
commit
2dc8687728
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue