From ec7a62e123e55eba3f2a7b48b8d09e3e16d5ff31 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Mon, 23 Dec 2019 16:20:12 +0300 Subject: [PATCH] -(home): fix duplicate check when adding a new ClientHost --- home/clients.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/clients.go b/home/clients.go index 573fae4d..ff53c6d4 100644 --- a/home/clients.go +++ b/home/clients.go @@ -455,8 +455,8 @@ func (clients *clientsContainer) AddHost(ip, host string, source clientSource) ( clients.lock.Lock() defer clients.lock.Unlock() - // check index - _, ok := clients.idIndex[ip] + // check existing clients first + _, ok := clients.Find(ip) if ok { return false, nil }