ax(node): replace prose comment with usage example on PeerRateLimiter.Allow
Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
442782a742
commit
e837423cb7
1 changed files with 1 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue