diff --git a/pkg/network/discovery.go b/pkg/network/discovery.go index c9e8dc49c..9d7073226 100644 --- a/pkg/network/discovery.go +++ b/pkg/network/discovery.go @@ -192,8 +192,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 dc69d3d7b..9c8fb1aad 100644 --- a/pkg/network/discovery_test.go +++ b/pkg/network/discovery_test.go @@ -81,6 +81,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") }