mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-05 22:33:10 +00:00
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:
parent
3368bed1d4
commit
e1d6b49b2d
2
score.go
2
score.go
@ -818,6 +818,7 @@ removeOldIPs:
|
|||||||
if ip == xip {
|
if ip == xip {
|
||||||
continue removeOldIPs
|
continue removeOldIPs
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// no, it's obsolete -- remove it from the tracker
|
// no, it's obsolete -- remove it from the tracker
|
||||||
peers, ok := ps.peerIPs[ip]
|
peers, ok := ps.peerIPs[ip]
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -828,7 +829,6 @@ removeOldIPs:
|
|||||||
delete(ps.peerIPs, ip)
|
delete(ps.peerIPs, ip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// removeIPs removes an IP list from the tracking list for a peer.
|
// removeIPs removes an IP list from the tracking list for a peer.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user