fix bug in peerScore.setIPs

It was removing all old addresses, not just the ones in the new addres slice
This commit is contained in:
vyzo 2020-04-14 10:16:40 +03:00
parent 3368bed1d4
commit e1d6b49b2d
1 changed files with 9 additions and 9 deletions

View File

@ -818,15 +818,15 @@ removeOldIPs:
if ip == xip {
continue removeOldIPs
}
// no, it's obsolete -- remove it from the tracker
peers, ok := ps.peerIPs[ip]
if !ok {
continue
}
delete(peers, p)
if len(peers) == 0 {
delete(ps.peerIPs, ip)
}
}
// no, it's obsolete -- remove it from the tracker
peers, ok := ps.peerIPs[ip]
if !ok {
continue
}
delete(peers, p)
if len(peers) == 0 {
delete(ps.peerIPs, ip)
}
}
}