Add logs when rate limited peer
This commit is contained in:
parent
14f4c40404
commit
1237cc9ac6
|
@ -1099,7 +1099,9 @@ func (w *Waku) HandlePeer(peer common.Peer, rw p2p.MsgReadWriter) error {
|
||||||
if w.rateLimiter != nil {
|
if w.rateLimiter != nil {
|
||||||
runLoop := func(out p2p.MsgReadWriter) error {
|
runLoop := func(out p2p.MsgReadWriter) error {
|
||||||
peer.SetRWWriter(out)
|
peer.SetRWWriter(out)
|
||||||
return peer.Run()
|
err := peer.Run()
|
||||||
|
w.logger.Info("handled peer", zap.String("peerID", types.EncodeHex(peer.ID())), zap.Error(err))
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return w.rateLimiter.Decorate(peer, rw, runLoop)
|
return w.rateLimiter.Decorate(peer, rw, runLoop)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue