forked from TrueCloudLab/neoneo-go
Merge pull request #1671 from nspcc-dev/register-connected-fix
network: don't register addresses before version handshake
This commit is contained in:
commit
a2921e38b7
2 changed files with 1 additions and 2 deletions
|
@ -192,8 +192,6 @@ func (d *DefaultDiscovery) tryAddress(addr string) {
|
||||||
if err := d.transport.Dial(addr, d.dialTimeout); err != nil {
|
if err := d.transport.Dial(addr, d.dialTimeout); err != nil {
|
||||||
d.RegisterBadAddr(addr)
|
d.RegisterBadAddr(addr)
|
||||||
d.RequestRemote(1)
|
d.RequestRemote(1)
|
||||||
} else {
|
|
||||||
d.RegisterConnectedAddr(addr)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,7 @@ func TestDefaultDiscoverer(t *testing.T) {
|
||||||
select {
|
select {
|
||||||
case a := <-ts.dialCh:
|
case a := <-ts.dialCh:
|
||||||
dialled = append(dialled, a)
|
dialled = append(dialled, a)
|
||||||
|
d.RegisterConnectedAddr(a)
|
||||||
case <-time.After(time.Second):
|
case <-time.After(time.Second):
|
||||||
t.Fatalf("timeout expecting for transport dial")
|
t.Fatalf("timeout expecting for transport dial")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue