mirror of https://github.com/status-im/go-waku.git
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()
|
||||
ip6 := ipAddr.IP.To16()
|
||||
if ip4 != nil && !ip4.IsUnspecified() {
|
||||
localnode.SetFallbackIP(ip4)
|
||||
localnode.Set(enr.IPv4(ip4))
|
||||
localnode.Set(enr.TCP(uint16(ipAddr.Port)))
|
||||
} else {
|
||||
localnode.Delete(enr.IPv4{})
|
||||
localnode.Delete(enr.TCP(0))
|
||||
localnode.SetFallbackIP(net.IP{127, 0, 0, 1})
|
||||
}
|
||||
|
||||
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...)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue