use numaddresses correctly

This commit is contained in:
tycho garen
2022-06-16 15:58:59 -04:00
parent b3363660e2
commit 30da89a1f8

View File

@@ -1006,7 +1006,7 @@ RETRY:
// peers is.
// nolint:gosec // G404: Use of weak random number generator
if len(ranked) <= int(limit) || rand.Intn((idx+1)*2) <= idx+1 {
if numAddresses <= int(limit) || rand.Intn((idx+1)*2) <= idx+1 {
seenAddresses[addressInfo.Address] = struct{}{}
addresses = append(addresses, addressInfo.Address)
addedLastIteration = true