From bcb68d23b3e78855be7d825ede37815d83b3142b Mon Sep 17 00:00:00 2001 From: cui Date: Sun, 10 May 2026 19:02:46 +0800 Subject: [PATCH] p2p: handle return false from TCPEndpoint (#34916) --- p2p/dial.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p2p/dial.go b/p2p/dial.go index f9463d6d89..0ffcd10497 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -67,7 +67,10 @@ type tcpDialer struct { } 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()) }