fix: check TCPAddr and log error on closing connection, then abort
This commit is contained in:
parent
1f8d383da7
commit
71cb44dc61
|
@ -91,8 +91,18 @@ func (h *HTTPServiceDefault) p2pHandler(ctx jape.Context) {
|
|||
if v.IP.IsLoopback() {
|
||||
err := peer.End()
|
||||
if err != nil {
|
||||
return
|
||||
h.Logger().Error("error ending peer", zap.Error(err))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
case *net.TCPAddr:
|
||||
if v.IP.IsLoopback() {
|
||||
err := peer.End()
|
||||
if err != nil {
|
||||
h.Logger().Error("error ending peer", zap.Error(err))
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue