remove or comment out unused code

This commit is contained in:
Anton Kaliaev
2019-02-06 15:16:38 +04:00
parent da33dd04cc
commit ffd3bf8448
10 changed files with 163 additions and 185 deletions
+3 -5
View File
@@ -480,14 +480,12 @@ func (sw *Switch) acceptRoutine() {
metrics: sw.metrics,
})
if err != nil {
switch err.(type) {
switch err := err.(type) {
case ErrRejected:
rErr := err.(ErrRejected)
if rErr.IsSelf() {
if err.IsSelf() {
// Remove the given address from the address book and add to our addresses
// to avoid dialing in the future.
addr := rErr.Addr()
addr := err.Addr()
sw.addrBook.RemoveAddress(&addr)
sw.addrBook.AddOurAddress(&addr)
}