optimisation: don't re-assign our ShortID if nothing got gc'ed

This commit is contained in:
Matthias Radestock committed 2015-12-30 14:07:23 +00:00
1 parent 0ecc0ee02e
commit 58de14ff65
1 file changed
+1 -1
+1 -1
View File
@@ -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
// collection might have freed some up, so try to
// reassign.