mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-08 07:06:43 +00:00
Fix wrong condition and add logs (#1435)
This commit is contained in:
parent
ad9c213a06
commit
effb545d20
@ -82,7 +82,7 @@ func HandleHandshake(context HandleHandshakeContext, netConnection *netadapter.N
|
|||||||
|
|
||||||
err := context.AddToPeers(peer)
|
err := context.AddToPeers(peer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.As(err, &common.ErrPeerWithSameIDExists) {
|
if errors.Is(err, common.ErrPeerWithSameIDExists) {
|
||||||
return nil, protocolerrors.Wrap(false, err, "peer already exists")
|
return nil, protocolerrors.Wrap(false, err, "peer already exists")
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -44,6 +44,7 @@ func (m *Manager) routerInitializer(router *routerpkg.Router, netConnection *net
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
if isBanned {
|
if isBanned {
|
||||||
|
log.Infof("Peer %s is banned. Disconnecting...", netConnection)
|
||||||
netConnection.Disconnect()
|
netConnection.Disconnect()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -87,6 +88,7 @@ func (m *Manager) handleError(err error, netConnection *netadapter.NetConnection
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.Debugf("Disconnecting from %s (reason: %s)", netConnection, protocolErr.Cause)
|
||||||
netConnection.Disconnect()
|
netConnection.Disconnect()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user