optimisation: don't re-assign our ShortID if nothing got gc'ed
This commit is contained in:
1 parent
0ecc0ee02e
commit
58de14ff65
1 file changed
+1
-1
+1
-1
@@ -395,7 +395,7 @@ func (peers *Peers) garbageCollect(pending *PeersPendingNotifications) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if peers.byShortID[peers.ourself.ShortID].peer != peers.ourself.Peer {
|
if len(pending.removed) > 0 && peers.byShortID[peers.ourself.ShortID].peer != peers.ourself.Peer {
|
||||||
// The local peer doesn't own its short id. Garbage
|
// The local peer doesn't own its short id. Garbage
|
||||||
// collection might have freed some up, so try to
|
// collection might have freed some up, so try to
|
||||||
// reassign.
|
// reassign.
|
||||||
|
|||||||
Reference in new issue
Block a user