Class: ChurnFilterPlugin

module:kadence/churnfilter~ ChurnFilterPlugin

Plugin that tracks contacts that are not online and evicts them from the routing table, prevents re-entry into the routing table using an exponential cooldown time.

new ChurnFilterPlugin(node [, options])

Parameters:
Name Type Argument Description
node AbstractNode
options object <optional>
Properties
Name Type Argument Default Description
cooldownMultiplier number <optional>
2 Multiply cooldown time by this number after every offense
cooldownResetTime string <optional>
"60M" Human time string for resetting the cooldown multiplier after no block added for a given peer fingerprint
cooldownBaseTimeout string <optional>
"5M" Human time string for starting timeout, multiplied by two every time the cooldown is reset and broken again
Source:

Methods


delBlock(fingerprint)

Deletes the blocked fingerprint
Parameters:
Name Type Description
fingerprint string | buffer Node ID to remove block
Source:

hasBlock(fingerprint)

Checks if the fingerprint is blocked
Parameters:
Name Type Description
fingerprint string | buffer Node ID to check
Source:
Returns:
Type
boolean

reset()

Clears all blocked and cooldown data
Source:

resetCooldownForStablePeers()

Releases blocked to reset cooldown multipliers for fingerprints with cooldowns that are long expired and not blocked
Source:

setBlock(fingerprint)

Creates a new block or renews the cooldown for an existing block
Parameters:
Name Type Description
fingerprint string | buffer Node ID to block
Source:
Returns:
Type
object