Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
node::TxOrphanageImpl::Announcement Struct Reference

One orphan announcement. More...

Public Member Functions

 Announcement (const CTransactionRef &tx, NodeId peer, SequenceNumber seq)
 
TxOrphanage::Usage GetMemUsage () const
 Get an approximation for "memory usage". More...
 
TxOrphanage::Count GetLatencyScore () const
 Get an approximation of how much this transaction contributes to latency in EraseForBlock and EraseForPeer. More...
 

Public Attributes

const CTransactionRef m_tx
 
const NodeId m_announcer
 Which peer announced this tx. More...
 
const SequenceNumber m_entry_sequence
 What order this transaction entered the orphanage. More...
 
bool m_reconsider {false}
 Whether this tx should be reconsidered. More...
 

Detailed Description

One orphan announcement.

Each announcement (i.e. combination of wtxid, nodeid) is unique. There may be multiple announcements for the same tx, and multiple transactions with the same txid but different wtxid are possible.

Definition at line 37 of file txorphanage.cpp.

Constructor & Destructor Documentation

◆ Announcement()

node::TxOrphanageImpl::Announcement::Announcement ( const CTransactionRef tx,
NodeId  peer,
SequenceNumber  seq 
)
inline

Definition at line 48 of file txorphanage.cpp.

Member Function Documentation

◆ GetLatencyScore()

TxOrphanage::Count node::TxOrphanageImpl::Announcement::GetLatencyScore ( ) const
inline

Get an approximation of how much this transaction contributes to latency in EraseForBlock and EraseForPeer.

The computation time is a function of the number of entries in m_orphans (thus 1 per announcement) and the number of entries in m_outpoint_to_orphan_wtxids (thus an additional 1 for every 10 inputs). Transactions with a small number of inputs (9 or fewer) are counted as 1 to make it easier to reason about each peer's limits in terms of "normal" transactions.

Definition at line 66 of file txorphanage.cpp.

Here is the caller graph for this function:

◆ GetMemUsage()

TxOrphanage::Usage node::TxOrphanageImpl::Announcement::GetMemUsage ( ) const
inline

Get an approximation for "memory usage".

The total memory is a function of the memory used to store the transaction itself, each entry in m_orphans, and each entry in m_outpoint_to_orphan_wtxids. We use weight because it is often higher than the actual memory usage of the transaction. This metric conveniently encompasses m_outpoint_to_orphan_wtxids usage since input data does not get the witness discount, and makes it easier to reason about each peer's limits using well-understood transaction attributes.

Definition at line 57 of file txorphanage.cpp.

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

Member Data Documentation

◆ m_announcer

const NodeId node::TxOrphanageImpl::Announcement::m_announcer

Which peer announced this tx.

Definition at line 41 of file txorphanage.cpp.

◆ m_entry_sequence

const SequenceNumber node::TxOrphanageImpl::Announcement::m_entry_sequence

What order this transaction entered the orphanage.

Definition at line 43 of file txorphanage.cpp.

◆ m_reconsider

bool node::TxOrphanageImpl::Announcement::m_reconsider {false}

Whether this tx should be reconsidered.

Always starts out false. A peer's workset is the collection of all announcements with m_reconsider=true.

Definition at line 46 of file txorphanage.cpp.

◆ m_tx

const CTransactionRef node::TxOrphanageImpl::Announcement::m_tx

Definition at line 39 of file txorphanage.cpp.


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