From d0af730042c90f34d8cef4d5088202bf8e3848c2 Mon Sep 17 00:00:00 2001 From: Matthew R Kasun Date: Thu, 19 Jan 2023 18:11:13 -0500 Subject: [PATCH] review comments --- logic/hosts.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/logic/hosts.go b/logic/hosts.go index 01227b0a..f6f30467 100644 --- a/logic/hosts.go +++ b/logic/hosts.go @@ -331,7 +331,7 @@ func CheckHostPorts(h *models.Host) { } func checkPort(h *models.Host, p int) int { - currentPort := h.ListenPort + currentPort := p count := 0 hosts, err := GetAllHosts() if err != nil { @@ -361,10 +361,7 @@ func checkPort(h *models.Host, p int) int { // HostExists - checks if given host already exists func HostExists(h *models.Host) bool { _, err := GetHost(h.ID.String()) - if (err != nil && !database.IsEmptyRecord(err)) || (err == nil) { - return true - } - return false + return (err != nil && !database.IsEmptyRecord(err)) || (err == nil) } func updatePort(p *int) {