Commit 7f507318 authored by Steven Allen's avatar Steven Allen

correctly handle the last bucket when generating random peer IDs

parent 4c093b4d
......@@ -78,7 +78,7 @@ func (rt *RoutingTable) GenRandPeerID(bucketID int) (peer.ID, error) {
var targetCpl int
if bucketID >= bucketLen-1 {
targetCpl = bucketLen
targetCpl = bucketLen - 1
} else {
targetCpl = bucketID
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment