![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
Actual implementation for TxRequestTracker's data structure. More...
Public Member Functions | |
| void | SanityCheck () const |
| void | PostGetRequestableSanityCheck (std::chrono::microseconds now) const |
| Impl (bool deterministic) | |
| Impl (const Impl &)=delete | |
| Impl & | operator= (const Impl &)=delete |
| void | DisconnectedPeer (NodeId peer) |
| void | ForgetTxHash (const uint256 &txhash) |
| void | GetCandidatePeers (const uint256 &txhash, std::vector< NodeId > &result_peers) const |
| void | ReceivedInv (NodeId peer, const GenTxid >xid, bool preferred, std::chrono::microseconds reqtime) |
| std::vector< GenTxid > | GetRequestable (NodeId peer, std::chrono::microseconds now, std::vector< std::pair< NodeId, GenTxid > > *expired) |
| Find the GenTxids to request now from peer. | |
| void | RequestedTx (NodeId peer, const uint256 &txhash, std::chrono::microseconds expiry) |
| void | ReceivedResponse (NodeId peer, const uint256 &txhash) |
| size_t | CountInFlight (NodeId peer) const |
| size_t | CountCandidates (NodeId peer) const |
| size_t | Count (NodeId peer) const |
| size_t | Size () const |
| Count how many announcements are being tracked in total across all peers and transactions. | |
| uint64_t | ComputePriority (const uint256 &txhash, NodeId peer, bool preferred) const |
Private Member Functions | |
| template<typename Tag > | |
| Iter< Tag > | Erase (Iter< Tag > it) |
| Wrapper around Index::...::erase that keeps m_peerinfo up to date. | |
| template<typename Tag , typename Modifier > | |
| void | Modify (Iter< Tag > it, Modifier modifier) |
| Wrapper around Index::...modify that keeps m_peerinfo up to date. | |
| void | PromoteCandidateReady (Iter< ByTxHash > it) |
| Convert a CANDIDATE_DELAYED announcement into a CANDIDATE_READY. | |
| void | ChangeAndReselect (Iter< ByTxHash > it, State new_state) |
| Change the state of an announcement to something non-IsSelected(). | |
| bool | IsOnlyNonCompleted (Iter< ByTxHash > it) |
| Check if 'it' is the only announcement for a given txhash that isn't COMPLETED. | |
| bool | MakeCompleted (Iter< ByTxHash > it) |
| Convert any announcement to a COMPLETED one. | |
| void | SetTimePoint (std::chrono::microseconds now, std::vector< std::pair< NodeId, GenTxid > > *expired) |
| Make the data structure consistent with a given point in time: | |
Private Attributes | |
| SequenceNumber | m_current_sequence {0} |
| The current sequence number. | |
| const PriorityComputer | m_computer |
| This tracker's priority computer. | |
| Index | m_index |
| This tracker's main data structure. See SanityCheck() for the invariants that apply to it. | |
| std::unordered_map< NodeId, PeerInfo > | m_peerinfo |
| Map with this tracker's per-peer statistics. | |
Actual implementation for TxRequestTracker's data structure.
Definition at line 301 of file txrequest.cpp.
|
inlineexplicit |
Definition at line 516 of file txrequest.cpp.
|
delete |
|
inlineprivate |
Change the state of an announcement to something non-IsSelected().
If it was IsSelected(), the next best announcement will be marked CANDIDATE_BEST.
Definition at line 421 of file txrequest.cpp.
Definition at line 695 of file txrequest.cpp.
Definition at line 688 of file txrequest.cpp.
Definition at line 681 of file txrequest.cpp.
Wrapper around Index::...::erase that keeps m_peerinfo up to date.
Definition at line 368 of file txrequest.cpp.
Definition at line 560 of file txrequest.cpp.
|
inline |
Find the GenTxids to request now from peer.
Definition at line 597 of file txrequest.cpp.
|
inlineprivate |
Check if 'it' is the only announcement for a given txhash that isn't COMPLETED.
Definition at line 438 of file txrequest.cpp.
|
inlineprivate |
Convert any announcement to a COMPLETED one.
If there are no non-COMPLETED announcements left for this txhash, they are deleted. If this was a REQUESTED announcement, and there are other CANDIDATEs left, the best one is made CANDIDATE_BEST. Returns whether the announcement still exists.
Definition at line 457 of file txrequest.cpp.
Wrapper around Index::...modify that keeps m_peerinfo up to date.
Definition at line 379 of file txrequest.cpp.
|
inline |
|
inlineprivate |
Convert a CANDIDATE_DELAYED announcement into a CANDIDATE_READY.
If this makes it the new best CANDIDATE_READY (and no REQUESTED exists) and better than the CANDIDATE_BEST (if any), it becomes the new CANDIDATE_BEST.
Definition at line 392 of file txrequest.cpp.
|
inline |
|
inlineprivate |
Make the data structure consistent with a given point in time:
Definition at line 484 of file txrequest.cpp.
|
inline |
Count how many announcements are being tracked in total across all peers and transactions.
Definition at line 703 of file txrequest.cpp.
|
private |
This tracker's priority computer.
Definition at line 307 of file txrequest.cpp.
|
private |
The current sequence number.
Increases for every announcement. This is used to sort txhashes returned by GetRequestable in announcement order.
Definition at line 304 of file txrequest.cpp.
|
private |
This tracker's main data structure. See SanityCheck() for the invariants that apply to it.
Definition at line 310 of file txrequest.cpp.
|
private |
Map with this tracker's per-peer statistics.
Definition at line 313 of file txrequest.cpp.