mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 05:43:06 +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
18
score.go
18
score.go
@ -818,15 +818,15 @@ removeOldIPs:
|
|||||||
if ip == xip {
|
if ip == xip {
|
||||||
continue removeOldIPs
|
continue removeOldIPs
|
||||||
}
|
}
|
||||||
// no, it's obsolete -- remove it from the tracker
|
}
|
||||||
peers, ok := ps.peerIPs[ip]
|
// no, it's obsolete -- remove it from the tracker
|
||||||
if !ok {
|
peers, ok := ps.peerIPs[ip]
|
||||||
continue
|
if !ok {
|
||||||
}
|
continue
|
||||||
delete(peers, p)
|
}
|
||||||
if len(peers) == 0 {
|
delete(peers, p)
|
||||||
delete(ps.peerIPs, ip)
|
if len(peers) == 0 {
|
||||||
}
|
delete(ps.peerIPs, ip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user