mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-11 17:31:35 +00:00
p2p: handle return false from TCPEndpoint
This commit is contained in:
parent
1abbae239d
commit
159720d4da
1 changed files with 4 additions and 1 deletions
|
|
@ -67,7 +67,10 @@ type tcpDialer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t tcpDialer) Dial(ctx context.Context, dest *enode.Node) (net.Conn, error) {
|
func (t tcpDialer) Dial(ctx context.Context, dest *enode.Node) (net.Conn, error) {
|
||||||
addr, _ := dest.TCPEndpoint()
|
addr, ok := dest.TCPEndpoint()
|
||||||
|
if !ok {
|
||||||
|
return nil, errNoPort
|
||||||
|
}
|
||||||
return t.d.DialContext(ctx, "tcp", addr.String())
|
return t.d.DialContext(ctx, "tcp", addr.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue