diff --git a/pkg/network/discovery.go b/pkg/network/discovery.go index 90fde6647..bdf391e39 100644 --- a/pkg/network/discovery.go +++ b/pkg/network/discovery.go @@ -177,8 +177,6 @@ func (d *DefaultDiscovery) tryAddress(addr string) { if err := d.transport.Dial(addr, d.dialTimeout); err != nil { d.RegisterBadAddr(addr) d.RequestRemote(1) - } else { - d.RegisterConnectedAddr(addr) } } diff --git a/pkg/network/discovery_test.go b/pkg/network/discovery_test.go index 08123ba2a..33e109fb1 100644 --- a/pkg/network/discovery_test.go +++ b/pkg/network/discovery_test.go @@ -59,6 +59,7 @@ func TestDefaultDiscoverer(t *testing.T) { select { case a := <-ts.dialCh: dialled = append(dialled, a) + d.RegisterConnectedAddr(a) case <-time.After(time.Second): t.Fatalf("timeout expecting for transport dial") }