5 #ifndef BITCOIN_TXORPHANAGE_H 6 #define BITCOIN_TXORPHANAGE_H 58 return m_orphans.size();
92 std::map<COutPoint, std::set<OrphanMap::iterator, IteratorComparator>> m_outpoint_to_orphan_it
GUARDED_BY(
m_mutex);
105 #endif // BITCOIN_TXORPHANAGE_H std::shared_ptr< const CTransaction > CTransactionRef
Mutex m_mutex
Guards orphan transactions.
A class to track orphan transactions (failed on TX_MISSING_INPUTS) Since we cannot distinguish orphan...
int EraseTxNoLock(const uint256 &txid) EXCLUSIVE_LOCKS_REQUIRED(m_mutex)
Erase an orphan by txid.
int EraseTx(const uint256 &txid) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Erase an orphan by txid.
bool HaveTxToReconsider(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Does this peer have any work to do?
std::map< uint256, OrphanTx > m_orphans GUARDED_BY(m_mutex)
Map from txid to orphan transaction record.
void EraseForPeer(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Erase all orphans announced by a peer (eg, after that peer disconnects)
size_t Size() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Return how many entries exist in the orphange.
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.
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...
#define EXCLUSIVE_LOCKS_REQUIRED(...)
decltype(m_orphans) OrphanMap
bool AddTx(const CTransactionRef &tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Add a new orphan transaction.
void EraseForBlock(const CBlock &block) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Erase all orphans included in or invalidated by a new block.
The basic transaction that is broadcasted on the network and contained in blocks. ...
bool operator()(const I &a, const I &b) const
bool HaveTx(const GenTxid >xid) const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Check if we already have an orphan transaction (by txid or wtxid)
A generic txid reference (txid or wtxid).
void LimitOrphans(unsigned int max_orphans) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Limit the orphanage to the given maximum.