Private implementation of TxDownloadManager.

Synopsis

Declared in <node/txdownloadman_impl.h>

class TxDownloadManagerImpl;

Types

Name

Description

PeerInfo

Per‐peer bookkeeping for peers we may download transactions from.

Member Functions

Name

Description

TxDownloadManagerImpl [constructor]

Construct the implementation from the download options.

ActiveTipChange

React to the active chain tip changing.

AddTxAnnouncement

Consider adding this tx hash to txrequest. Should be called whenever a new inv has been received. Also called internally when a transaction is missing parents so that we can request them.

AlreadyHaveTx

Check whether we already have this gtxid in: ‐ mempool ‐ orphanage ‐ m_recent_rejects ‐ m_recent_rejects_reconsiderable (if include_reconsiderable = true) ‐ m_recent_confirmed_transactions

BlockConnected

React to a block being connected to the active chain.

BlockDisconnected

React to a block being disconnected from the active chain.

CheckIsEmpty

CheckIsEmpty overloads

ConnectedPeer

Register a peer we may download transactions from.

DisconnectedPeer

Remove all request and orphan state for a disconnecting peer.

Find1P1CPackage

Look for a child of this transaction in the orphanage to form a 1‐parent‐1‐child package, skipping any combinations that have already been tried. Return the resulting package along with the senders of its respective transactions, or std::nullopt if no package is found.

GetOrphanTransactions

Return info for every orphan transaction currently stored.

GetRequestsToSend

Get getdata requests to send.

GetTxToReconsider

Return the next orphan transaction to reconsider for a peer.

HaveMoreWork

Report whether the peer has orphan work pending.

MempoolAcceptedTx

Respond to a transaction being accepted into the mempool.

MempoolRejectedPackage

Respond to a package being rejected from the mempool.

MempoolRejectedTx

Respond to a transaction being rejected from the mempool.

ReceivedNotFound

Marks a tx as ReceivedResponse in txrequest.

ReceivedTx

Process a received transaction and decide whether it should be validated.

RecentConfirmedTransactionsFilter

Lazily construct and return the recently‐confirmed transactions filter.

RecentRejectsFilter

Lazily construct and return the recently‐rejected transactions filter.

RecentRejectsReconsiderableFilter

Lazily construct and return the reconsiderable‐rejects filter.

Data Members

Name

Description

m_lazy_recent_confirmed_transactions

Filter for transactions that have been recently confirmed. We use this to avoid requesting transactions that have already been confirmed.

m_lazy_recent_rejects

Filter for transactions that were recently rejected by the mempool. These are not rerequested until the chain tip changes, at which point the entire filter is reset.

m_lazy_recent_rejects_reconsiderable

Filter for: (1) wtxids of transactions that were recently rejected by the mempool but are eligible for reconsideration if submitted with other transactions. (2) packages (see GetPackageHash) we have already rejected before and should not retry.

m_mempool

Read‐only reference to the node's mempool.

m_num_wtxid_peers

Number of wtxid relay peers we have in m_peer_info.

m_orphanage

Manages unvalidated tx data (orphan transactions for which we are downloading ancestors).

m_peer_info

Information for all of the peers we may download transactions from. This is not necessarily all peers we are connected to (no block‐relay‐only and temporary connections).

m_rng

Random context used for request scheduling and shuffling.

m_txrequest

Tracks candidates for requesting and downloading transaction data.

Protected Member Functions

Name

Description

GetUniqueParents

Helper for getting deduplicated vector of Txids in vin.

MaybeAddOrphanResolutionCandidate

If this peer is an orphan resolution candidate for this transaction, treat the unique_parents as announced by this peer; add them as new invs to m_txrequest.

Created with MrDocs