Move public IP services handling to a map-based approach to work for daemon (multiple network configs) and CLI-based setting of the IP services.

This commit is contained in:
cameronts
2022-07-28 14:33:47 -07:00
parent 05283eff14
commit f656a48f3a
6 changed files with 21 additions and 7 deletions

View File

@@ -85,7 +85,7 @@ func JoinNetwork(cfg *config.ClientConfig, privateKey string) error {
if cfg.Node.IsLocal == "yes" && cfg.Node.LocalAddress != "" {
cfg.Node.Endpoint = cfg.Node.LocalAddress
} else {
cfg.Node.Endpoint, err = ncutils.GetPublicIP(cfg.PublicIPService)
cfg.Node.Endpoint, err = ncutils.GetPublicIP()
}
if err != nil || cfg.Node.Endpoint == "" {
logger.Log(0, "network:", cfg.Network, "error setting cfg.Node.Endpoint.")