Skip to content

Commit d85d778

Browse files
AaronChen0stwiname
authored andcommitted
p2p/enode: fix TCPEndpoint (ethereum#29827)
1 parent a9d0941 commit d85d778

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

p2p/enode/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (n *Node) TCP() int {
184184
return int(n.tcp)
185185
}
186186

187-
// UDPEndpoint returns the announced TCP endpoint.
187+
// UDPEndpoint returns the announced UDP endpoint.
188188
func (n *Node) UDPEndpoint() (netip.AddrPort, bool) {
189189
if !n.ip.IsValid() || n.ip.IsUnspecified() || n.udp == 0 {
190190
return netip.AddrPort{}, false
@@ -197,7 +197,7 @@ func (n *Node) TCPEndpoint() (netip.AddrPort, bool) {
197197
if !n.ip.IsValid() || n.ip.IsUnspecified() || n.tcp == 0 {
198198
return netip.AddrPort{}, false
199199
}
200-
return netip.AddrPortFrom(n.ip, n.udp), true
200+
return netip.AddrPortFrom(n.ip, n.tcp), true
201201
}
202202

203203
// Pubkey returns the secp256k1 public key of the node, if present.

0 commit comments

Comments
 (0)