[#node-TxDownloadManagerImpl] = xref:node.adoc[node]::TxDownloadManagerImpl :relfileprefix: ../ :mrdocs: Private implementation of TxDownloadManager. == Synopsis Declared in `<node/txdownloadman_impl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class TxDownloadManagerImpl; ---- == Types [cols="1,4"] |=== | Name| Description | xref:node/TxDownloadManagerImpl/PeerInfo.adoc[`PeerInfo`] | Per‐peer bookkeeping for peers we may download transactions from. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:node/TxDownloadManagerImpl/2constructor.adoc[`TxDownloadManagerImpl`] [.small]#[constructor]# | Construct the implementation from the download options. | xref:node/TxDownloadManagerImpl/ActiveTipChange.adoc[`ActiveTipChange`] | React to the active chain tip changing. | xref:node/TxDownloadManagerImpl/AddTxAnnouncement.adoc[`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. | xref:node/TxDownloadManagerImpl/AlreadyHaveTx.adoc[`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 | xref:node/TxDownloadManagerImpl/BlockConnected.adoc[`BlockConnected`] | React to a block being connected to the active chain. | xref:node/TxDownloadManagerImpl/BlockDisconnected.adoc[`BlockDisconnected`] | React to a block being disconnected from the active chain. | xref:node/TxDownloadManagerImpl/CheckIsEmpty-04.adoc[`CheckIsEmpty`] | `CheckIsEmpty` overloads | xref:node/TxDownloadManagerImpl/ConnectedPeer.adoc[`ConnectedPeer`] | Register a peer we may download transactions from. | xref:node/TxDownloadManagerImpl/DisconnectedPeer.adoc[`DisconnectedPeer`] | Remove all request and orphan state for a disconnecting peer. | xref:node/TxDownloadManagerImpl/Find1P1CPackage.adoc[`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. | xref:node/TxDownloadManagerImpl/GetOrphanTransactions.adoc[`GetOrphanTransactions`] | Return info for every orphan transaction currently stored. | xref:node/TxDownloadManagerImpl/GetRequestsToSend.adoc[`GetRequestsToSend`] | Get getdata requests to send. | xref:node/TxDownloadManagerImpl/GetTxToReconsider.adoc[`GetTxToReconsider`] | Return the next orphan transaction to reconsider for a peer. | xref:node/TxDownloadManagerImpl/HaveMoreWork.adoc[`HaveMoreWork`] | Report whether the peer has orphan work pending. | xref:node/TxDownloadManagerImpl/MempoolAcceptedTx.adoc[`MempoolAcceptedTx`] | Respond to a transaction being accepted into the mempool. | xref:node/TxDownloadManagerImpl/MempoolRejectedPackage.adoc[`MempoolRejectedPackage`] | Respond to a package being rejected from the mempool. | xref:node/TxDownloadManagerImpl/MempoolRejectedTx.adoc[`MempoolRejectedTx`] | Respond to a transaction being rejected from the mempool. | xref:node/TxDownloadManagerImpl/ReceivedNotFound.adoc[`ReceivedNotFound`] | Marks a tx as ReceivedResponse in txrequest. | xref:node/TxDownloadManagerImpl/ReceivedTx.adoc[`ReceivedTx`] | Process a received transaction and decide whether it should be validated. | xref:node/TxDownloadManagerImpl/RecentConfirmedTransactionsFilter.adoc[`RecentConfirmedTransactionsFilter`] | Lazily construct and return the recently‐confirmed transactions filter. | xref:node/TxDownloadManagerImpl/RecentRejectsFilter.adoc[`RecentRejectsFilter`] | Lazily construct and return the recently‐rejected transactions filter. | xref:node/TxDownloadManagerImpl/RecentRejectsReconsiderableFilter.adoc[`RecentRejectsReconsiderableFilter`] | Lazily construct and return the reconsiderable‐rejects filter. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:node/TxDownloadManagerImpl/m_lazy_recent_confirmed_transactions.adoc[`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. | xref:node/TxDownloadManagerImpl/m_lazy_recent_rejects.adoc[`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. | xref:node/TxDownloadManagerImpl/m_lazy_recent_rejects_reconsiderable.adoc[`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. | xref:node/TxDownloadManagerImpl/m_mempool.adoc[`m_mempool`] | Read‐only reference to the node's mempool. | xref:node/TxDownloadManagerImpl/m_num_wtxid_peers.adoc[`m_num_wtxid_peers`] | Number of wtxid relay peers we have in m_peer_info. | xref:node/TxDownloadManagerImpl/m_orphanage.adoc[`m_orphanage`] | Manages unvalidated tx data (orphan transactions for which we are downloading ancestors). | xref:node/TxDownloadManagerImpl/m_peer_info.adoc[`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). | xref:node/TxDownloadManagerImpl/m_rng.adoc[`m_rng`] | Random context used for request scheduling and shuffling. | xref:node/TxDownloadManagerImpl/m_txrequest.adoc[`m_txrequest`] | Tracks candidates for requesting and downloading transaction data. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:node/TxDownloadManagerImpl/GetUniqueParents.adoc[`GetUniqueParents`] | Helper for getting deduplicated vector of Txids in vin. | xref:node/TxDownloadManagerImpl/MaybeAddOrphanResolutionCandidate.adoc[`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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#