multi: use timeout field in dialer

This commit is contained in:
yyforyongyu
2020-08-25 12:50:48 +08:00
parent fb67b58d3f
commit ef38b12fda
7 changed files with 35 additions and 29 deletions

View File

@@ -271,7 +271,7 @@ func (s *server) ConnectPeer(nodePub *btcec.PublicKey, addrs []net.Addr) error {
// Attempt to connect to the peer using this full address. If
// we're unable to connect to them, then we'll try the next
// address in place of it.
err := s.ConnectToPeer(netAddr, true)
err := s.ConnectToPeer(netAddr, true, s.cfg.ConnectionTimeout)
// If we're already connected to this peer, then we don't
// consider this an error, so we'll exit here.