From 91ca96534b6bd247e317299f9e0f9c2054e89617 Mon Sep 17 00:00:00 2001 From: afeiszli Date: Fri, 22 Apr 2022 08:53:05 -0400 Subject: [PATCH] adding comments, removing bad check --- logic/peers.go | 2 +- netclient/functions/localport.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/logic/peers.go b/logic/peers.go index 99d8e7f4..c24c92ab 100644 --- a/logic/peers.go +++ b/logic/peers.go @@ -212,7 +212,7 @@ func GetPeerUpdate(node *models.Node) (models.PeerUpdate, error) { } else { continue } - if node.LocalListenPort != peer.LocalListenPort && peer.LocalListenPort != 0 { + if peer.LocalListenPort != 0 { peer.ListenPort = peer.LocalListenPort } else { continue diff --git a/netclient/functions/localport.go b/netclient/functions/localport.go index a361d8a4..01102e59 100644 --- a/netclient/functions/localport.go +++ b/netclient/functions/localport.go @@ -2,7 +2,6 @@ package functions import ( "errors" - "log" "strconv" "strings" @@ -28,6 +27,7 @@ func GetLocalListenPort(ifacename string) (int32, error) { return int32(i), nil } +// UpdateLocalListenPort - check local port, if different, mod config and publish func UpdateLocalListenPort(nodeCfg *config.ClientConfig) error { var err error ifacename := getRealIface(nodeCfg.Node.Interface, nodeCfg.Node.Address) @@ -41,7 +41,6 @@ func UpdateLocalListenPort(nodeCfg *config.ClientConfig) error { if err != nil { return err } - log.Println("server: " + nodeCfg.Server.Server) if err := PublishNodeUpdate(nodeCfg); err != nil { logger.Log(0, "could not publish local port change") }