From abfb4c890161ca3328201de4a77e8a3e93427b16 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 21 Apr 2019 11:18:24 +0300 Subject: [PATCH] fix bug in findRelaysOnce: it connects to all relays --- p2p/host/relay/autorelay.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/p2p/host/relay/autorelay.go b/p2p/host/relay/autorelay.go index 669f65fd..05a1c101 100644 --- a/p2p/host/relay/autorelay.go +++ b/p2p/host/relay/autorelay.go @@ -159,6 +159,9 @@ func (ar *AutoRelay) findRelaysOnce(ctx context.Context) bool { update := false for _, pi := range pis { update = ar.tryRelay(ctx, pi) || update + if ar.numRelays() >= DesiredRelays { + break + } } return update }