les: short circuit in the unregister if peer is not registered (#19644)

This commit is contained in:
gary rong 2019-05-31 15:54:50 +08:00 committed by Péter Szilágyi
parent 58497f46bd
commit f2612ac948

View File

@ -193,7 +193,11 @@ func (f *freeClientPool) disconnect(address string) {
if f.closed {
return
}
// Short circuit if the peer hasn't been registered.
e := f.addressMap[address]
if e == nil {
return
}
now := f.clock.Now()
if !e.connected {
log.Debug("Client already disconnected", "address", address)