diff --git a/p2p/host/relay/autorelay.go b/p2p/host/relay/autorelay.go index 13020793..8d8302da 100644 --- a/p2p/host/relay/autorelay.go +++ b/p2p/host/relay/autorelay.go @@ -116,7 +116,8 @@ func (h *AutoRelayHost) findRelays(ctx context.Context) { h.mx.Unlock() limit := 20 - for ; need > limit; limit *= 2 { + if need > limit/2 { + limit = 2 * need } dctx, cancel := context.WithTimeout(ctx, 60*time.Second)