Skip to content

Commit b2c178d

Browse files
AaronChen0pratikspatil024
authored andcommitted
p2p/enode: fix TCPEndpoint (ethereum#29827)
1 parent be1e580 commit b2c178d

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
@@ -189,7 +189,7 @@ func (n *Node) TCP() int {
189189
return int(n.tcp)
190190
}
191191

192-
// UDPEndpoint returns the announced TCP endpoint.
192+
// UDPEndpoint returns the announced UDP endpoint.
193193
func (n *Node) UDPEndpoint() (netip.AddrPort, bool) {
194194
if !n.ip.IsValid() || n.ip.IsUnspecified() || n.udp == 0 {
195195
return netip.AddrPort{}, false
@@ -202,7 +202,7 @@ func (n *Node) TCPEndpoint() (netip.AddrPort, bool) {
202202
if !n.ip.IsValid() || n.ip.IsUnspecified() || n.tcp == 0 {
203203
return netip.AddrPort{}, false
204204
}
205-
return netip.AddrPortFrom(n.ip, n.udp), true
205+
return netip.AddrPortFrom(n.ip, n.tcp), true
206206
}
207207

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

0 commit comments

Comments
 (0)