Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | List of all members
TxOrphanageTest Class Reference
Inheritance diagram for TxOrphanageTest:
[legend]
Collaboration diagram for TxOrphanageTest:
[legend]

Public Member Functions

size_t CountOrphans () const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 
CTransactionRef RandomOrphan () EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 
- Public Member Functions inherited from TxOrphanage
bool AddTx (const CTransactionRef &tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Add a new orphan transaction. More...
 
bool HaveTx (const GenTxid &gtxid) const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Check if we already have an orphan transaction (by txid or wtxid) More...
 
CTransactionRef GetTxToReconsider (NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Extract a transaction from a peer's work set Returns nullptr if there are no transactions to work on. More...
 
int EraseTx (const Txid &txid) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Erase an orphan by txid. More...
 
void EraseForPeer (NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Erase all orphans announced by a peer (eg, after that peer disconnects) More...
 
void EraseForBlock (const CBlock &block) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Erase all orphans included in or invalidated by a new block. More...
 
void LimitOrphans (unsigned int max_orphans, FastRandomContext &rng) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Limit the orphanage to the given maximum. More...
 
void AddChildrenToWorkSet (const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Add any orphans that list a particular tx as a parent into the from peer's work set. More...
 
bool HaveTxToReconsider (NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Does this peer have any work to do? More...
 
size_t Size () EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Return how many entries exist in the orphange. More...
 

Additional Inherited Members

- Protected Types inherited from TxOrphanage
using OrphanMap = decltype(m_orphans)
 
- Protected Member Functions inherited from TxOrphanage
std::map< Txid, OrphanTx > m_orphans GUARDED_BY (m_mutex)
 Map from txid to orphan transaction record. More...
 
std::map< NodeId, std::set< Txid > > m_peer_work_set GUARDED_BY (m_mutex)
 Which peer provided the orphans that need to be reconsidered. More...
 
std::map< COutPoint, std::set< OrphanMap::iterator, IteratorComparator > > m_outpoint_to_orphan_it GUARDED_BY (m_mutex)
 Index from the parents' COutPoint into the m_orphans. More...
 
std::vector< OrphanMap::iterator > m_orphan_list GUARDED_BY (m_mutex)
 Orphan transactions in vector for quick random eviction. More...
 
std::map< Wtxid, OrphanMap::iterator > m_wtxid_to_orphan_it GUARDED_BY (m_mutex)
 Index from wtxid into the m_orphans to lookup orphan transactions using their witness ids. More...
 
int EraseTxNoLock (const Txid &txid) EXCLUSIVE_LOCKS_REQUIRED(m_mutex)
 Erase an orphan by txid. More...
 
- Protected Attributes inherited from TxOrphanage
Mutex m_mutex
 Guards orphan transactions. More...
 

Detailed Description

Definition at line 21 of file orphanage_tests.cpp.

Member Function Documentation

◆ CountOrphans()

size_t TxOrphanageTest::CountOrphans ( ) const
inline

Definition at line 24 of file orphanage_tests.cpp.

Here is the caller graph for this function:

◆ RandomOrphan()

CTransactionRef TxOrphanageTest::RandomOrphan ( )
inline

Definition at line 30 of file orphanage_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: