rippled
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...

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. More...
 
void removeSquelch (PublicKey const &validator)
 Remove the squelch. More...
 
bool expireSquelch (PublicKey const &validator)
 Remove expired squelch. More...
 

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. More...
 
const beast::Journal journal_
 

Detailed Description

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

Maintains squelching of relaying messages from validators.

Definition at line 38 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 40 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 43 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 80 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 102 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 109 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 74 of file Squelch.h.

◆ journal_

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

Definition at line 75 of file Squelch.h.