3#include <xrpld/overlay/ReduceRelayCommon.h>
5#include <xrpl/basics/Log.h>
6#include <xrpl/beast/utility/Journal.h>
7#include <xrpl/protocol/PublicKey.h>
14template <
typename ClockType>
53template <
typename ClockType>
61 squelched_[validator] = ClockType::now() + squelchDuration;
65 JLOG(
journal_.error()) <<
"squelch: invalid squelch duration " << squelchDuration.
count();
73template <
typename ClockType>
80template <
typename ClockType>
84 auto now = ClockType::now();
A generic endpoint for log messages.
Squelch(beast::Journal journal)
hash_map< PublicKey, time_point > squelched_
Maintains the list of squelched relaying to downstream peers.
ClockType::time_point time_point
void removeSquelch(PublicKey const &validator)
Remove the squelch.
bool expireSquelch(PublicKey const &validator)
Remove expired squelch.
beast::Journal const journal_
bool addSquelch(PublicKey const &validator, std::chrono::seconds const &squelchDuration)
Squelch validation/proposal relaying for the validator.
virtual ~Squelch()=default
static constexpr auto kMinUnsquelchExpire
static constexpr auto kMaxUnsquelchExpirePeers
std::unordered_map< Key, Value, Hash, Pred, Allocator > hash_map