mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
p2p/enode: fix ipv6 address used as extip results in 127.0.0.1 being
This commit is contained in:
parent
57164d4d8c
commit
577a52a056
1 changed files with 5 additions and 2 deletions
|
|
@ -114,8 +114,11 @@ func (n *Node) IP() net.IP {
|
|||
if n.Load(&ip6) == nil {
|
||||
return net.IP(ip6)
|
||||
}
|
||||
if net.IP(ip4).IsLoopback() {
|
||||
return net.IP(ip4)
|
||||
if n.Load(&ip4) == nil {
|
||||
ipv4Addr := net.IP(ip4)
|
||||
if ipv4Addr.IsLoopback() {
|
||||
return ipv4Addr
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue