fix: add incoming peer to ip block too, and add more logging
This commit is contained in:
parent
ab53dbdf08
commit
bbb407b0e1
|
@ -244,13 +244,18 @@ func (p *P2PImpl) ConnectToNode(connectionUris []*url.URL, retried bool, fromPee
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
fromPeerIP := fromPeer.GetIP()
|
||||||
p.incomingPeerBlockList.Put(fromPeerId, true)
|
p.incomingPeerBlockList.Put(fromPeerId, true)
|
||||||
|
p.incomingIPBlocklist.Put(fromPeerIP, true)
|
||||||
err = fromPeer.End()
|
err = fromPeer.End()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.logger.Info("blocking peer for sending peer on blocklist", zap.String("node", connectionUri.String()), zap.String("peer", fromPeerId), zap.String("ip", fromPeerIP))
|
||||||
}
|
}
|
||||||
p.outgoingPeerBlocklist.Put(idString, true)
|
p.outgoingPeerBlocklist.Put(idString, true)
|
||||||
|
p.logger.Info("blocking peer for too many failures", zap.String("node", connectionUri.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue