diff --git a/lib/tokenBucket.js b/lib/tokenBucket.js index 6d78862..bac8c5b 100644 --- a/lib/tokenBucket.js +++ b/lib/tokenBucket.js @@ -137,7 +137,7 @@ TokenBucket.prototype = { return false; // Try to remove the requested tokens from the parent bucket - if (this.parentBucket && !this.parent.tryRemoveTokens(count)) + if (this.parentBucket && !this.parentBucket.tryRemoveTokens(count)) return false; // Remove the requested tokens from this bucket and return