Skip to content

Commit

Permalink
Merge pull request #127 from libp2p/use-resolved-address
Browse files Browse the repository at this point in the history
use the resolved address for RemoteMultiaddr()
  • Loading branch information
Stebalien authored Mar 16, 2020
2 parents c21973c + bbd82c0 commit 28e61ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions p2p/transport/quic/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ func (t *transport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (tp
if err != nil {
return nil, err
}
udpAddr, err := net.ResolveUDPAddr(network, host)
addr, err := net.ResolveUDPAddr(network, host)
if err != nil {
return nil, err
}
addr, err := fromQuicMultiaddr(raddr)
remoteMultiaddr, err := toQuicMultiaddr(addr)
if err != nil {
return nil, err
}
tlsConf, keyCh := t.identity.ConfigForPeer(p)
pconn, err := t.connManager.Dial(network, udpAddr)
pconn, err := t.connManager.Dial(network, addr)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -167,7 +167,7 @@ func (t *transport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (tp
localMultiaddr: localMultiaddr,
remotePubKey: remotePubKey,
remotePeerID: p,
remoteMultiaddr: raddr,
remoteMultiaddr: remoteMultiaddr,
}, nil
}

Expand Down

0 comments on commit 28e61ca

Please sign in to comment.