Skip to content

Commit

Permalink
print drops from routing table.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Sep 6, 2018
1 parent 18e7410 commit fe69e24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion table.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ func (rt *RoutingTable) Update(p peer.ID) {
if bucketID == len(rt.Buckets)-1 {
rt.nextBucket()
} else {
dropped := bucket.PopBack()
fmt.Printf("old peer dropped in favour of incoming peer, dropped: %v, new: %v\n", dropped.String(), p.String())
// If the bucket cant split kick out least active node
rt.PeerRemoved(bucket.PopBack())
rt.PeerRemoved(dropped)
}
}
}
Expand Down

0 comments on commit fe69e24

Please sign in to comment.