network: register connected addr in handleVersionCmd()

Prevent useless attempts to connect to this peer if the peer has already made
a connection to us.
This commit is contained in:
Roman Khimov 2020-01-28 19:10:13 +03:00
parent 9eafec0d1d
commit eb4ec61b8b
3 changed files with 6 additions and 3 deletions

View file

@ -136,6 +136,7 @@ func (d testDiscovery) BackFill(addrs ...string) {}
func (d testDiscovery) PoolCount() int { return 0 }
func (d testDiscovery) RegisterBadAddr(string) {}
func (d testDiscovery) RegisterGoodAddr(string) {}
func (d testDiscovery) RegisterConnectedAddr(string) {}
func (d testDiscovery) UnregisterConnectedAddr(string) {}
func (d testDiscovery) UnconnectedPeers() []string { return []string{} }
func (d testDiscovery) RequestRemote(n int) {}