xrpld
Loading...
Searching...
No Matches
xrpl::reduce_relay::Squelch< ClockType > Class Template Reference

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

#include <Squelch.h>

Collaboration diagram for xrpl::reduce_relay::Squelch< ClockType >:

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 = ClockType::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 ClockType>
class xrpl::reduce_relay::Squelch< ClockType >

Maintains squelching of relaying messages from validators.

Definition at line 15 of file Squelch.h.

Member Typedef Documentation

◆ time_point

template<typename ClockType>
using xrpl::reduce_relay::Squelch< ClockType >::time_point = ClockType::time_point
private

Definition at line 17 of file Squelch.h.

Constructor & Destructor Documentation

◆ Squelch()

template<typename ClockType>
xrpl::reduce_relay::Squelch< ClockType >::Squelch ( beast::Journal journal)
explicit

Definition at line 20 of file Squelch.h.

◆ ~Squelch()

template<typename ClockType>
virtual xrpl::reduce_relay::Squelch< ClockType >::~Squelch ( )
virtualdefault

Member Function Documentation

◆ addSquelch()

template<typename ClockType>
bool xrpl::reduce_relay::Squelch< ClockType >::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 55 of file Squelch.h.

◆ removeSquelch()

template<typename ClockType>
void xrpl::reduce_relay::Squelch< ClockType >::removeSquelch ( PublicKey const & validator)

Remove the squelch.

Parameters
validatorThe validator's public key

Definition at line 75 of file Squelch.h.

◆ expireSquelch()

template<typename ClockType>
bool xrpl::reduce_relay::Squelch< ClockType >::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 82 of file Squelch.h.

Member Data Documentation

◆ squelched_

template<typename ClockType>
hash_map<PublicKey, time_point> xrpl::reduce_relay::Squelch< ClockType >::squelched_
private

Maintains the list of squelched relaying to downstream peers.

Expiration time is included in the TMSquelch message.

Definition at line 49 of file Squelch.h.

◆ journal_

template<typename ClockType>
beast::Journal const xrpl::reduce_relay::Squelch< ClockType >::journal_
private

Definition at line 50 of file Squelch.h.