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

pull/19653/head
gary rong 6 years ago committed by Péter Szilágyi
parent 58497f46bd
commit f2612ac948
  1. 4
      les/freeclient.go

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

Loading…
Cancel
Save