mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-13 07:14:10 +00:00
fix: setFallbackIP with reported libp2p addr (#808)
This commit is contained in:
parent
f6460efee9
commit
bfee9964f6
@ -43,11 +43,13 @@ func (w *WakuNode) updateLocalNode(localnode *enode.LocalNode, multiaddrs []ma.M
|
|||||||
ip4 := ipAddr.IP.To4()
|
ip4 := ipAddr.IP.To4()
|
||||||
ip6 := ipAddr.IP.To16()
|
ip6 := ipAddr.IP.To16()
|
||||||
if ip4 != nil && !ip4.IsUnspecified() {
|
if ip4 != nil && !ip4.IsUnspecified() {
|
||||||
|
localnode.SetFallbackIP(ip4)
|
||||||
localnode.Set(enr.IPv4(ip4))
|
localnode.Set(enr.IPv4(ip4))
|
||||||
localnode.Set(enr.TCP(uint16(ipAddr.Port)))
|
localnode.Set(enr.TCP(uint16(ipAddr.Port)))
|
||||||
} else {
|
} else {
|
||||||
localnode.Delete(enr.IPv4{})
|
localnode.Delete(enr.IPv4{})
|
||||||
localnode.Delete(enr.TCP(0))
|
localnode.Delete(enr.TCP(0))
|
||||||
|
localnode.SetFallbackIP(net.IP{127, 0, 0, 1})
|
||||||
}
|
}
|
||||||
|
|
||||||
if ip4 == nil && ip6 != nil && !ip6.IsUnspecified() {
|
if ip4 == nil && ip6 != nil && !ip6.IsUnspecified() {
|
||||||
@ -59,8 +61,6 @@ func (w *WakuNode) updateLocalNode(localnode *enode.LocalNode, multiaddrs []ma.M
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
localnode.SetFallbackIP(net.IP{127, 0, 0, 1})
|
|
||||||
|
|
||||||
return wenr.Update(localnode, options...)
|
return wenr.Update(localnode, options...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user