diff --git a/pkg/node/transport.go b/pkg/node/transport.go index 57c441f..1aed486 100644 --- a/pkg/node/transport.go +++ b/pkg/node/transport.go @@ -134,7 +134,7 @@ func NewPeerRateLimiter(maxTokens, refillRate int) *PeerRateLimiter { } } -// Allow checks if a message is allowed and consumes a token if so +// if limiter.Allow() { process(msg) } else { drop(msg) } func (r *PeerRateLimiter) Allow() bool { r.mutex.Lock() defer r.mutex.Unlock()