|
xrpld
|
Routing table for objects identified by hash. More...
#include <HashRouter.h>

Classes | |
| struct | Setup |
| Structure used to customize HashRouter behavior. More... | |
| class | Entry |
| An entry in the routing table. More... | |
Public Types | |
| using | PeerShortID = std::uint32_t |
Public Member Functions | |
| HashRouter (Setup const &setup, Stopwatch &clock) | |
| HashRouter & | operator= (HashRouter const &)=delete |
| virtual | ~HashRouter ()=default |
| void | addSuppression (uint256 const &key) |
| bool | addSuppressionPeer (uint256 const &key, PeerShortID peer) |
| 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, HashRouterFlags &flags) |
| bool | shouldProcess (uint256 const &key, PeerShortID peer, HashRouterFlags &flags, std::chrono::seconds txInterval) |
| bool | setFlags (uint256 const &key, HashRouterFlags flags) |
| Set the flags on a hash. | |
| HashRouterFlags | getFlags (uint256 const &key) |
| std::optional< std::set< PeerShortID > > | shouldRelay (uint256 const &key) |
| Determines whether the hashed item should be relayed. | |
Private Member Functions | |
| std::pair< Entry &, bool > | emplace (uint256 const &) |
Private Attributes | |
| std::mutex | mutex_ |
| Setup const | setup_ |
| beast::aged_unordered_map< uint256, Entry, Stopwatch::clock_type, HardenedHash< strong_hash > > | suppressionMap_ |
Routing table for objects identified by hash.
This table keeps track of which hashes have been received by which peers. It is used to manage the routing and broadcasting of messages in the peer to peer overlay.
Definition at line 76 of file HashRouter.h.
Definition at line 80 of file HashRouter.h.
Definition at line 181 of file HashRouter.h.
|
virtualdefault |
|
delete |
| void xrpl::HashRouter::addSuppression | ( | uint256 const & | key | ) |
Definition at line 35 of file HashRouter.cpp.
| bool xrpl::HashRouter::addSuppressionPeer | ( | uint256 const & | key, |
| PeerShortID | peer ) |
Definition at line 43 of file HashRouter.cpp.
| std::pair< bool, std::optional< Stopwatch::time_point > > xrpl::HashRouter::addSuppressionPeerWithStatus | ( | uint256 const & | key, |
| PeerShortID | peer ) |
Add a suppression peer and get message's relay status.
Return pair: element 1: true if the peer is added. element 2: optional is seated to the relay time point or is unseated if has not relayed yet.
Definition at line 49 of file HashRouter.cpp.
| bool xrpl::HashRouter::addSuppressionPeer | ( | uint256 const & | key, |
| PeerShortID | peer, | ||
| HashRouterFlags & | flags ) |
Definition at line 59 of file HashRouter.cpp.
| bool xrpl::HashRouter::shouldProcess | ( | uint256 const & | key, |
| PeerShortID | peer, | ||
| HashRouterFlags & | flags, | ||
| std::chrono::seconds | txInterval ) |
Definition at line 70 of file HashRouter.cpp.
| bool xrpl::HashRouter::setFlags | ( | uint256 const & | key, |
| HashRouterFlags | flags ) |
Set the flags on a hash.
Definition at line 94 of file HashRouter.cpp.
| HashRouterFlags xrpl::HashRouter::getFlags | ( | uint256 const & | key | ) |
Definition at line 86 of file HashRouter.cpp.
| auto xrpl::HashRouter::shouldRelay | ( | uint256 const & | key | ) |
Determines whether the hashed item should be relayed.
Effects:
If the item should be relayed, this function will not return a seated optional again until the relay time has expired. The internal set of peers will also be reset.
Definition at line 110 of file HashRouter.cpp.
|
private |
Definition at line 18 of file HashRouter.cpp.
|
mutableprivate |
Definition at line 247 of file HashRouter.h.
|
private |
Definition at line 250 of file HashRouter.h.
|
private |
Definition at line 254 of file HashRouter.h.