p2p: log NAT ExternalIP error (#8026)

This commit is contained in:
battlmonstr 2023-08-22 10:51:00 +02:00 committed by GitHub
parent d2d261e560
commit 6c017c33f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -568,8 +568,11 @@ func (srv *Server) setupLocalNode() error {
defer debug.LogPanic()
defer srv.loopWG.Done()
if ip, err := srv.NAT.ExternalIP(); err == nil {
srv.logger.Info("NAT ExternalIP resolved", "ip", ip)
srv.localnode.SetStaticIP(ip)
srv.updateLocalNodeStaticAddrCache()
} else {
srv.logger.Warn("NAT ExternalIP resolution has failed, try to pass a different --nat option", "err", err)
}
}()
}