-(home): fix duplicate check when adding a new ClientHost
This commit is contained in:
parent
b4f4111609
commit
ec7a62e123
|
@ -455,8 +455,8 @@ func (clients *clientsContainer) AddHost(ip, host string, source clientSource) (
|
||||||
clients.lock.Lock()
|
clients.lock.Lock()
|
||||||
defer clients.lock.Unlock()
|
defer clients.lock.Unlock()
|
||||||
|
|
||||||
// check index
|
// check existing clients first
|
||||||
_, ok := clients.idIndex[ip]
|
_, ok := clients.Find(ip)
|
||||||
if ok {
|
if ok {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue