rippled
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
ripple::reduce_relay::Squelch< clock_type > Class Template Reference

Maintains squelching of relaying messages from validators. More...

#include <Squelch.h>

Collaboration diagram for ripple::reduce_relay::Squelch< clock_type >:
Collaboration graph
[legend]

Public Member Functions

 Squelch (beast::Journal journal)
 
virtual ~Squelch ()=default
 
bool addSquelch (PublicKey const &validator, std::chrono::seconds const &squelchDuration)
 Squelch validation/proposal relaying for the validator.
 
void removeSquelch (PublicKey const &validator)
 Remove the squelch.
 
bool expireSquelch (PublicKey const &validator)
 Remove expired squelch.
 

Private Types

using time_point = typename clock_type::time_point
 

Private Attributes

hash_map< PublicKey, time_pointsquelched_
 Maintains the list of squelched relaying to downstream peers.
 
beast::Journal const journal_
 

Detailed Description

template<typename clock_type>
class ripple::reduce_relay::Squelch< clock_type >

Maintains squelching of relaying messages from validators.

Definition at line 19 of file Squelch.h.

Member Typedef Documentation

◆ time_point

template<typename clock_type >
using ripple::reduce_relay::Squelch< clock_type >::time_point = typename clock_type::time_point
private

Definition at line 21 of file Squelch.h.

Constructor & Destructor Documentation

◆ Squelch()

template<typename clock_type >
ripple::reduce_relay::Squelch< clock_type >::Squelch ( beast::Journal  journal)
explicit

Definition at line 24 of file Squelch.h.

◆ ~Squelch()

template<typename clock_type >
virtual ripple::reduce_relay::Squelch< clock_type >::~Squelch ( )
virtualdefault

Member Function Documentation

◆ addSquelch()

template<typename clock_type >
bool ripple::reduce_relay::Squelch< clock_type >::addSquelch ( PublicKey const &  validator,
std::chrono::seconds const &  squelchDuration 
)

Squelch validation/proposal relaying for the validator.

Parameters
validatorThe validator's public key
squelchDurationSquelch duration in seconds
Returns
false if invalid squelch duration

Definition at line 61 of file Squelch.h.

◆ removeSquelch()

template<typename clock_type >
void ripple::reduce_relay::Squelch< clock_type >::removeSquelch ( PublicKey const &  validator)

Remove the squelch.

Parameters
validatorThe validator's public key

Definition at line 83 of file Squelch.h.

◆ expireSquelch()

template<typename clock_type >
bool ripple::reduce_relay::Squelch< clock_type >::expireSquelch ( PublicKey const &  validator)

Remove expired squelch.

Parameters
validatorValidator's public key
Returns
true if removed or doesn't exist, false if still active

Definition at line 90 of file Squelch.h.

Member Data Documentation

◆ squelched_

template<typename clock_type >
hash_map<PublicKey, time_point> ripple::reduce_relay::Squelch< clock_type >::squelched_
private

Maintains the list of squelched relaying to downstream peers.

Expiration time is included in the TMSquelch message.

Definition at line 55 of file Squelch.h.

◆ journal_

template<typename clock_type >
beast::Journal const ripple::reduce_relay::Squelch< clock_type >::journal_
private

Definition at line 56 of file Squelch.h.