Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
optimisation: don't re-assign our ShortID if nothing got gc'ed
Browse files Browse the repository at this point in the history
  • Loading branch information
rade committed Dec 30, 2015
1 parent 0ecc0ee commit 58de14f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesh/peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 58de14f

Please sign in to comment.