![]() |
Bitcoin Core 32.99.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 299 of file txrequest.cpp.
|
inlineexplicit |
Definition at line 514 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 419 of file txrequest.cpp.
Definition at line 693 of file txrequest.cpp.
Definition at line 686 of file txrequest.cpp.
Definition at line 679 of file txrequest.cpp.
Wrapper around Index::...::erase that keeps m_peerinfo up to date.
Definition at line 366 of file txrequest.cpp.
Definition at line 558 of file txrequest.cpp.
|
inline |
Find the GenTxids to request now from peer.
Definition at line 595 of file txrequest.cpp.
|
inlineprivate |
Check if 'it' is the only announcement for a given txhash that isn't COMPLETED.
Definition at line 436 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 455 of file txrequest.cpp.
Wrapper around Index::...modify that keeps m_peerinfo up to date.
Definition at line 377 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 390 of file txrequest.cpp.
|
inline |
|
inlineprivate |
Make the data structure consistent with a given point in time:
Definition at line 482 of file txrequest.cpp.
|
inline |
Count how many announcements are being tracked in total across all peers and transactions.
Definition at line 701 of file txrequest.cpp.
|
private |
This tracker's priority computer.
Definition at line 305 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 302 of file txrequest.cpp.
|
private |
This tracker's main data structure. See SanityCheck() for the invariants that apply to it.
Definition at line 308 of file txrequest.cpp.
|
private |
Map with this tracker's per-peer statistics.
Definition at line 311 of file txrequest.cpp.