![]() |
Bitcoin Core 28.99.0
P2P Digital Currency
|
Public Member Functions | |
TxOrphanageTest (FastRandomContext &rng) | |
size_t | CountOrphans () const |
CTransactionRef | RandomOrphan () |
![]() | |
bool | AddTx (const CTransactionRef &tx, NodeId peer) |
Add a new orphan transaction. More... | |
bool | AddAnnouncer (const Wtxid &wtxid, NodeId peer) |
Add an additional announcer to an orphan if it exists. More... | |
CTransactionRef | GetTx (const Wtxid &wtxid) const |
bool | HaveTx (const Wtxid &wtxid) const |
Check if we already have an orphan transaction (by wtxid only) More... | |
bool | HaveTxFromPeer (const Wtxid &wtxid, NodeId peer) const |
Check if a {tx, peer} exists in the orphanage. More... | |
CTransactionRef | GetTxToReconsider (NodeId peer) |
Extract a transaction from a peer's work set Returns nullptr if there are no transactions to work on. More... | |
int | EraseTx (const Wtxid &wtxid) |
Erase an orphan by wtxid. More... | |
void | EraseForPeer (NodeId peer) |
Maybe erase all orphans announced by a peer (eg, after that peer disconnects). More... | |
void | EraseForBlock (const CBlock &block) |
Erase all orphans included in or invalidated by a new block. More... | |
void | LimitOrphans (unsigned int max_orphans, FastRandomContext &rng) |
Limit the orphanage to the given maximum. More... | |
void | AddChildrenToWorkSet (const CTransaction &tx, FastRandomContext &rng) |
Add any orphans that list a particular tx as a parent into the from peer's work set. More... | |
bool | HaveTxToReconsider (NodeId peer) |
Does this peer have any work to do? More... | |
std::vector< CTransactionRef > | GetChildrenFromSamePeer (const CTransactionRef &parent, NodeId nodeid) const |
Get all children that spend from this tx and were received from nodeid. More... | |
size_t | Size () const |
Return how many entries exist in the orphange. More... | |
std::vector< OrphanTxBase > | GetOrphanTransactions () const |
unsigned int | TotalOrphanUsage () const |
Get the total usage (weight) of all orphans. More... | |
unsigned int | UsageByPeer (NodeId peer) const |
Total usage (weight) of orphans for which this peer is an announcer. More... | |
void | SanityCheck () const |
Check consistency between PeerOrphanInfo and m_orphans. More... | |
Public Attributes | |
FastRandomContext & | m_rng |
Additional Inherited Members | |
![]() | |
using | OrphanMap = decltype(m_orphans) |
![]() | |
unsigned int | m_total_orphan_usage {0} |
Total usage (weight) of all entries in m_orphans. More... | |
unsigned int | m_total_announcements {0} |
Total number of <peer, tx> pairs. More... | |
std::map< Wtxid, OrphanTx > | m_orphans |
Map from wtxid to orphan transaction record. More... | |
std::map< NodeId, PeerOrphanInfo > | m_peer_orphanage_info |
std::map< COutPoint, std::set< OrphanMap::iterator, IteratorComparator > > | m_outpoint_to_orphan_it |
Index from the parents' COutPoint into the m_orphans. More... | |
std::vector< OrphanMap::iterator > | m_orphan_list |
Orphan transactions in vector for quick random eviction. More... | |
NodeSeconds | m_next_sweep {0s} |
Timestamp for the next scheduled sweep of expired orphans. More... | |
Definition at line 24 of file orphanage_tests.cpp.
|
inline |
Definition at line 27 of file orphanage_tests.cpp.
|
inline |
Definition at line 29 of file orphanage_tests.cpp.
|
inline |
FastRandomContext& TxOrphanageTest::m_rng |
Definition at line 43 of file orphanage_tests.cpp.