Bitcoin ABC 0.26.3
P2P Digital Currency
|
Actual implementation for InvRequestTracker's data structure. More...
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< ByInvId > it) |
Convert a CANDIDATE_DELAYED announcement into a CANDIDATE_READY. | |
void | ChangeAndReselect (Iter< ByInvId > it, State new_state) |
Change the state of an announcement to something non-IsSelected(). | |
bool | IsOnlyNonCompleted (Iter< ByInvId > it) |
Check if 'it' is the only announcement for a given invid that isn't COMPLETED. | |
bool | MakeCompleted (Iter< ByInvId > it) |
Convert any announcement to a COMPLETED one. | |
void | SetTimePoint (std::chrono::microseconds now, ClearExpiredFun clearExpired, EmplaceExpiredFun emplaceExpired) |
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. | |
std::unordered_map< NodeId, PeerInfo > | m_peerinfo |
Map with this tracker's per-peer statistics. | |
Additional Inherited Members | |
Public Types inherited from InvRequestTrackerImplInterface | |
using | ClearExpiredFun = const std::function< void()> & |
using | EmplaceExpiredFun = const std::function< void(const NodeId &, const uint256 &)> & |
Actual implementation for InvRequestTracker's data structure.
Definition at line 356 of file invrequest.cpp.
|
inlineexplicit |
Definition at line 623 of file invrequest.cpp.
|
delete |
|
default |
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 499 of file invrequest.cpp.
|
inlinevirtual |
Implements InvRequestTrackerImplInterface.
Definition at line 855 of file invrequest.cpp.
Implements InvRequestTrackerImplInterface.
Definition at line 843 of file invrequest.cpp.
Implements InvRequestTrackerImplInterface.
Definition at line 834 of file invrequest.cpp.
Implements InvRequestTrackerImplInterface.
Definition at line 826 of file invrequest.cpp.
Implements InvRequestTrackerImplInterface.
Definition at line 641 of file invrequest.cpp.
Wrapper around Index::...::erase that keeps m_peerinfo up to date.
Definition at line 433 of file invrequest.cpp.
Implements InvRequestTrackerImplInterface.
Definition at line 683 of file invrequest.cpp.
|
inlinevirtual |
Find the InvIds to request now from peer.
Implements InvRequestTrackerImplInterface.
Definition at line 718 of file invrequest.cpp.
Check if 'it' is the only announcement for a given invid that isn't COMPLETED.
Definition at line 522 of file invrequest.cpp.
Convert any announcement to a COMPLETED one.
If there are no non-COMPLETED announcements left for this invid, 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 553 of file invrequest.cpp.
Wrapper around Index::...modify that keeps m_peerinfo up to date.
Definition at line 445 of file invrequest.cpp.
|
delete |
|
inlinevirtual |
Implements InvRequestTrackerImplInterface.
Definition at line 414 of file invrequest.cpp.
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 458 of file invrequest.cpp.
|
inlinevirtual |
Implements InvRequestTrackerImplInterface.
Definition at line 691 of file invrequest.cpp.
Implements InvRequestTrackerImplInterface.
Definition at line 814 of file invrequest.cpp.
|
inlinevirtual |
Implements InvRequestTrackerImplInterface.
Definition at line 751 of file invrequest.cpp.
|
inlinevirtual |
Implements InvRequestTrackerImplInterface.
Definition at line 372 of file invrequest.cpp.
|
inlineprivate |
Make the data structure consistent with a given point in time:
Definition at line 585 of file invrequest.cpp.
|
inlinevirtual |
Count how many announcements are being tracked in total across all peers and transactions.
Implements InvRequestTrackerImplInterface.
Definition at line 853 of file invrequest.cpp.
|
private |
This tracker's priority computer.
Definition at line 362 of file invrequest.cpp.
|
private |
The current sequence number.
Increases for every announcement. This is used to sort invid returned by GetRequestable in announcement order.
Definition at line 359 of file invrequest.cpp.
|
private |
This tracker's main data structure.
See SanityCheck() for the invariants that apply to it.
Definition at line 366 of file invrequest.cpp.
|
private |
Map with this tracker's per-peer statistics.
Definition at line 369 of file invrequest.cpp.