![]() |
Bitcoin Core 29.99.0
P2P Digital Currency
|
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... | |
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.
|
inline |
Definition at line 48 of file txorphanage.cpp.
|
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.
|
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.
const NodeId node::TxOrphanageImpl::Announcement::m_announcer |
Which peer announced this tx.
Definition at line 41 of file txorphanage.cpp.
const SequenceNumber node::TxOrphanageImpl::Announcement::m_entry_sequence |
What order this transaction entered the orphanage.
Definition at line 43 of file txorphanage.cpp.
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.
const CTransactionRef node::TxOrphanageImpl::Announcement::m_tx |
Definition at line 39 of file txorphanage.cpp.