Skip to content

Commit

Permalink
fix for extra values
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Jun 24, 2024
1 parent b287eac commit 2d8faa3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions p2p/pex/pex_reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ func (r *Reactor) ensurePeersCommon(regionAware bool) {

reserveSizeInRegion := cmtmath.MaxInt((numToDialInSameRegion+1)/2, 5)
reserveSizeOutOfRegion := cmtmath.MaxInt((numToDialInOtherRegion+1)/2, 5)
if numToDialInSameRegion == 0 {
reserveSizeInRegion = 0
}
if numToDialInOtherRegion == 0 {
reserveSizeOutOfRegion = 0
}

// First iteration: Dial peers in the same region
for i := 0; i < maxAttempts && len(toDialInRegion) < numToDialInSameRegion+reserveSizeInRegion; i++ {
Expand Down

0 comments on commit 2d8faa3

Please sign in to comment.