|
rippled
|
Routing table for objects identified by hash. More...

Classes | |
| class | Entry |
| An entry in the routing table. More... | |
Public Types | |
| using | PeerShortID = std::uint32_t |
Public Member Functions | |
| HashRouter (Stopwatch &clock, std::chrono::seconds entryHoldTimeInSeconds, std::uint32_t recoverLimit) | |
| HashRouter & | operator= (HashRouter const &)=delete |
| virtual | ~HashRouter ()=default |
| void | addSuppression (uint256 const &key) |
| bool | addSuppressionPeer (uint256 const &key, PeerShortID peer) |
| bool | addSuppressionPeer (uint256 const &key, PeerShortID peer, int &flags) |
| bool | shouldProcess (uint256 const &key, PeerShortID peer, int &flags, std::chrono::seconds tx_interval) |
| bool | setFlags (uint256 const &key, int flags) |
| Set the flags on a hash. More... | |
| int | getFlags (uint256 const &key) |
| boost::optional< std::set< PeerShortID > > | shouldRelay (uint256 const &key) |
| Determines whether the hashed item should be relayed. More... | |
| bool | shouldRecover (uint256 const &key) |
| Determines whether the hashed item should be recovered from the open ledger into the next open ledger or the transaction queue. More... | |
Static Public Member Functions | |
| static std::chrono::seconds | getDefaultHoldTime () |
| static std::uint32_t | getDefaultRecoverLimit () |
Private Member Functions | |
| std::pair< Entry &, bool > | emplace (uint256 const &) |
Private Attributes | |
| std::mutex | mutex_ |
| beast::aged_unordered_map< uint256, Entry, Stopwatch::clock_type, hardened_hash< strong_hash > > | suppressionMap_ |
| const std::chrono::seconds | holdTime_ |
| const std::uint32_t | recoverLimit_ |
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 52 of file HashRouter.h.
Definition at line 56 of file HashRouter.h.
| ripple::HashRouter::HashRouter | ( | Stopwatch & | clock, |
| std::chrono::seconds | entryHoldTimeInSeconds, | ||
| std::uint32_t | recoverLimit | ||
| ) |
Definition at line 165 of file HashRouter.h.
|
virtualdefault |
|
static |
Definition at line 152 of file HashRouter.h.
|
static |
Definition at line 160 of file HashRouter.h.
|
delete |
| void ripple::HashRouter::addSuppression | ( | uint256 const & | key | ) |
Definition at line 43 of file HashRouter.cpp.
| bool ripple::HashRouter::addSuppressionPeer | ( | uint256 const & | key, |
| PeerShortID | peer | ||
| ) |
Definition at line 51 of file HashRouter.cpp.
| bool ripple::HashRouter::addSuppressionPeer | ( | uint256 const & | key, |
| PeerShortID | peer, | ||
| int & | flags | ||
| ) |
Definition at line 61 of file HashRouter.cpp.
| bool ripple::HashRouter::shouldProcess | ( | uint256 const & | key, |
| PeerShortID | peer, | ||
| int & | flags, | ||
| std::chrono::seconds | tx_interval | ||
| ) |
Definition at line 72 of file HashRouter.cpp.
| bool ripple::HashRouter::setFlags | ( | uint256 const & | key, |
| int | flags | ||
| ) |
Set the flags on a hash.
true if the flags were changed. false if unchanged. Definition at line 96 of file HashRouter.cpp.
| int ripple::HashRouter::getFlags | ( | uint256 const & | key | ) |
Definition at line 88 of file HashRouter.cpp.
| auto ripple::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 `true` again until the hold time has expired. The internal set of peers will also be reset.
boost::optional set of peers which do not need to be relayed to. If the result is uninitialized, the item should not be relayed. Definition at line 112 of file HashRouter.cpp.
| bool ripple::HashRouter::shouldRecover | ( | uint256 const & | key | ) |
Determines whether the hashed item should be recovered from the open ledger into the next open ledger or the transaction queue.
bool indicates whether the item should be recovered Definition at line 126 of file HashRouter.cpp.
|
private |
Definition at line 25 of file HashRouter.cpp.
|
mutableprivate |
Definition at line 238 of file HashRouter.h.
|
private |
Definition at line 246 of file HashRouter.h.
|
private |
Definition at line 248 of file HashRouter.h.
|
private |
Definition at line 250 of file HashRouter.h.
1.8.17