Skip to content

Commit

Permalink
Router: bypass throttle when lookup sent to client DB
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay committed Oct 18, 2023
1 parent 00e3390 commit b80505f
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,21 @@ boolean shouldThrottleFlood(Hash key) {
* @since 0.7.11
*/
boolean shouldThrottleLookup(Hash from, TunnelId id) {
if (isClientDb()) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Lookup for:" + from + " sent to a client DB: "+_dbid.toString()+", bypassing throttle");
return false;
}
// null before startup
return _lookupThrottler == null || _lookupThrottler.shouldThrottle(from, id);
}

boolean shouldThrottleBurstLookup(Hash from, TunnelId id) {
if (isClientDb()) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Lookup for:" + from + " sent to a client DB: "+_dbid.toString()+", bypassing throttle");
return false;
}
// null before startup
return _lookupThrottlerBurst == null || _lookupThrottlerBurst.shouldThrottle(from, id);
}
Expand Down

0 comments on commit b80505f

Please sign in to comment.