class LookupThrottler extends Object
Tracks the frequency of recent lookup requests targeting specific reply peer/tunnel pairs to prevent abuse. Implements burst detection over sliding time windows and configurable request limits.
Note this is basic DOS protection and does not prevent spoofed reply identifiers or multiple reply tunnels from malicious requestors.
| Constructor and Description |
|---|
LookupThrottler(FloodfillNetworkDatabaseFacade facade)Throttle for the given floodfill facade. |
LookupThrottler(FloodfillNetworkDatabaseFacade facade,
int maxlookups,
int maxnonfflookups,
long cleanTime)Throttle with configurable lookup limits. |
| Modifier and Type | Method and Description |
|---|---|
(package private) void | cancel()Stop the periodic cleaner. |
(package private) boolean | shouldThrottle(Hash key,
TunnelId id)Increment and check throttling for the given peer and tunnel. |
LookupThrottler(FloodfillNetworkDatabaseFacade facade)
facade - floodfill network database facadeLookupThrottler(FloodfillNetworkDatabaseFacade facade, int maxlookups, int maxnonfflookups, long cleanTime)
facade - floodfill network database facademaxlookups - when floodfillmaxnonfflookups - when not floodfillcleanTime - milliseconds between throttling table cleanups