20 #include <ripple/app/misc/HashRouter.h>
27 auto iter = suppressionMap_.find(key);
29 if (iter != suppressionMap_.end())
31 suppressionMap_.touch(iter);
36 expire(suppressionMap_, holdTime_);
39 std::ref(suppressionMap_.emplace(key,
Entry()).first->second),
true);
62 result.first.addPeer(peer);
63 return {result.second, result.first.relayed()};
71 auto [s, created] =
emplace(key);
87 auto& s = result.first;
98 return emplace(key).first.getFlags();
110 if ((s.getFlags() & flags) == flags)
123 auto& s = emplace(key).first;
125 if (!s.shouldRelay(suppressionMap_.clock().now(), holdTime_))
128 return s.releasePeerSet();
std::pair< bool, std::optional< Stopwatch::time_point > > addSuppressionPeerWithStatus(uint256 const &key, PeerShortID peer)
Add a suppression peer and get message's relay status.
bool addSuppressionPeer(uint256 const &key, PeerShortID peer)
std::pair< Entry &, bool > emplace(uint256 const &)
int getFlags(uint256 const &key)
An entry in the routing table.
bool shouldProcess(uint256 const &key, PeerShortID peer, int &flags, std::chrono::seconds tx_interval)
Integers of any length that is a multiple of 32-bits.
beast::aged_unordered_map< uint256, Entry, Stopwatch::clock_type, hardened_hash< strong_hash > > suppressionMap_
void addSuppression(uint256 const &key)
bool shouldRecover(uint256 const &key)
Determines whether the hashed item should be recovered from the open ledger into the next open ledger...
std::optional< std::set< PeerShortID > > shouldRelay(uint256 const &key)
Determines whether the hashed item should be relayed.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const std::uint32_t recoverLimit_
bool setFlags(uint256 const &key, int flags)
Set the flags on a hash.