Class BanManager
Constructors
Name | Description |
this
(config, clock, db, logger)
|
Ctor.
|
Fields
Name | Type | Description |
log
|
Logger | Logger instance
|
Methods
Name | Description |
ban
(address)
|
Manually ban an address using the configured ban time in the ban config.
|
banFor
(address, duration)
|
Manually ban an address, for the specified number of seconds from
the current time.
|
banUntil
(address, banned_until)
|
Manually ban an address, until the specified time.
|
isBanned
(address)
|
Checks whether the address is considered banned
|
isWhitelisted
(address)
|
Checks whether the address is whitelisted
|
onFailedRequest
(address, fail_count_inc)
|
Updates the fail count for this address
|
unwhitelist
(address)
|
Unwhitelist an address to allow banning it
|
whitelist
(address)
|
Whitelist an address to avoid banning it
|
getCurTime
()
|
Get the current time. Overridable for unittests.
|
Inner structs
Name | Description |
Config
|
Ban configuration
|