mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
p2p: use proper comparison in URLv4 generation
This commit is contained in:
parent
da4e59d392
commit
ca438bd2e2
1 changed files with 1 additions and 1 deletions
|
|
@ -207,7 +207,7 @@ func (n *Node) URLv4() string {
|
||||||
nodeid = fmt.Sprintf("%s.%x", scheme, n.id[:])
|
nodeid = fmt.Sprintf("%s.%x", scheme, n.id[:])
|
||||||
}
|
}
|
||||||
u := url.URL{Scheme: "enode"}
|
u := url.URL{Scheme: "enode"}
|
||||||
if n.NeedResolve() {
|
if n.Hostname() != "" {
|
||||||
// For DNS nodes: include DNS name, TCP port, and optional UDP port
|
// For DNS nodes: include DNS name, TCP port, and optional UDP port
|
||||||
u.User = url.User(nodeid)
|
u.User = url.User(nodeid)
|
||||||
u.Host = fmt.Sprintf("%s:%d", n.Hostname(), n.TCP())
|
u.Host = fmt.Sprintf("%s:%d", n.Hostname(), n.TCP())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue