From 6c064cd4c6bb4c3b4574139ba2cb4ef4d3bcaddc Mon Sep 17 00:00:00 2001 From: "Matthew R. Kasun" Date: Tue, 22 Feb 2022 22:34:08 -0500 Subject: [PATCH] ensure new listen port is written to config files and mq uses comms network --- netclient/functions/daemon.go | 2 +- netclient/functions/join.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/netclient/functions/daemon.go b/netclient/functions/daemon.go index 24f01a42..cae086cb 100644 --- a/netclient/functions/daemon.go +++ b/netclient/functions/daemon.go @@ -333,7 +333,7 @@ func getCommsNetworks(networks []string) (map[string]bool, error) { func getCommsCfgByNode(node *models.Node) config.ClientConfig { var commsCfg config.ClientConfig - commsCfg.Network = node.Network + commsCfg.Network = node.CommID commsCfg.ReadConfig() return commsCfg } diff --git a/netclient/functions/join.go b/netclient/functions/join.go index 44b0d0ec..70a4c425 100644 --- a/netclient/functions/join.go +++ b/netclient/functions/join.go @@ -215,7 +215,7 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string, iscomms bool) error setListenPort(oldListenPort, &cfg) - err = config.ModConfig(&node) + err = config.ModConfig(&cfg.Node) if err != nil { return err } @@ -298,7 +298,6 @@ func setListenPort(oldListenPort int32, cfg *config.ClientConfig) { // if newListenPort has been modified to find an available port, publish to server if cfg.Node.ListenPort != newListenPort { var currentCommsCfg = getCommsCfgByNode(&cfg.Node) - log.Println("DELETE ME: publishing update of port: " + string(cfg.Node.ListenPort)) PublishNodeUpdate(¤tCommsCfg, cfg) } }