[#node-TxDownloadManagerImpl]
= xref:node.adoc[node]::TxDownloadManagerImpl
:relfileprefix: ../
:mrdocs:

Private implementation of TxDownloadManager&period;

== Synopsis

Declared in `&lt;node&sol;txdownloadman&lowbar;impl&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class TxDownloadManagerImpl;
----

== Types

[cols="1,4"]
|===
| Name| Description
| xref:node/TxDownloadManagerImpl/PeerInfo.adoc[`PeerInfo`] 
| Per&hyphen;peer bookkeeping for peers we may download transactions from&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:node/TxDownloadManagerImpl/2constructor.adoc[`TxDownloadManagerImpl`]         [.small]#[constructor]#
| Construct the implementation from the download options&period;
| xref:node/TxDownloadManagerImpl/ActiveTipChange.adoc[`ActiveTipChange`] 
| React to the active chain tip changing&period;
| xref:node/TxDownloadManagerImpl/AddTxAnnouncement.adoc[`AddTxAnnouncement`] 
| Consider adding this tx hash to txrequest&period; Should be called whenever a new inv has been received&period; Also called internally when a transaction is missing parents so that we can request them&period;
| xref:node/TxDownloadManagerImpl/AlreadyHaveTx.adoc[`AlreadyHaveTx`] 
| Check whether we already have this gtxid in&colon; &hyphen; mempool &hyphen; orphanage &hyphen; m&lowbar;recent&lowbar;rejects &hyphen; m&lowbar;recent&lowbar;rejects&lowbar;reconsiderable (if include&lowbar;reconsiderable &equals; true) &hyphen; m&lowbar;recent&lowbar;confirmed&lowbar;transactions
| xref:node/TxDownloadManagerImpl/BlockConnected.adoc[`BlockConnected`] 
| React to a block being connected to the active chain&period;
| xref:node/TxDownloadManagerImpl/BlockDisconnected.adoc[`BlockDisconnected`] 
| React to a block being disconnected from the active chain&period;
| xref:node/TxDownloadManagerImpl/CheckIsEmpty-04.adoc[`CheckIsEmpty`] 
| `CheckIsEmpty` overloads
| xref:node/TxDownloadManagerImpl/ConnectedPeer.adoc[`ConnectedPeer`] 
| Register a peer we may download transactions from&period;
| xref:node/TxDownloadManagerImpl/DisconnectedPeer.adoc[`DisconnectedPeer`] 
| Remove all request and orphan state for a disconnecting peer&period;
| xref:node/TxDownloadManagerImpl/Find1P1CPackage.adoc[`Find1P1CPackage`] 
| Look for a child of this transaction in the orphanage to form a 1&hyphen;parent&hyphen;1&hyphen;child package, skipping any combinations that have already been tried&period; Return the resulting package along with the senders of its respective transactions, or std&colon;&colon;nullopt if no package is found&period;
| xref:node/TxDownloadManagerImpl/GetOrphanTransactions.adoc[`GetOrphanTransactions`] 
| Return info for every orphan transaction currently stored&period;
| xref:node/TxDownloadManagerImpl/GetRequestsToSend.adoc[`GetRequestsToSend`] 
| Get getdata requests to send&period;
| xref:node/TxDownloadManagerImpl/GetTxToReconsider.adoc[`GetTxToReconsider`] 
| Return the next orphan transaction to reconsider for a peer&period;
| xref:node/TxDownloadManagerImpl/HaveMoreWork.adoc[`HaveMoreWork`] 
| Report whether the peer has orphan work pending&period;
| xref:node/TxDownloadManagerImpl/MempoolAcceptedTx.adoc[`MempoolAcceptedTx`] 
| Respond to a transaction being accepted into the mempool&period;
| xref:node/TxDownloadManagerImpl/MempoolRejectedPackage.adoc[`MempoolRejectedPackage`] 
| Respond to a package being rejected from the mempool&period;
| xref:node/TxDownloadManagerImpl/MempoolRejectedTx.adoc[`MempoolRejectedTx`] 
| Respond to a transaction being rejected from the mempool&period;
| xref:node/TxDownloadManagerImpl/ReceivedNotFound.adoc[`ReceivedNotFound`] 
| Marks a tx as ReceivedResponse in txrequest&period;
| xref:node/TxDownloadManagerImpl/ReceivedTx.adoc[`ReceivedTx`] 
| Process a received transaction and decide whether it should be validated&period;
| xref:node/TxDownloadManagerImpl/RecentConfirmedTransactionsFilter.adoc[`RecentConfirmedTransactionsFilter`] 
| Lazily construct and return the recently&hyphen;confirmed transactions filter&period;
| xref:node/TxDownloadManagerImpl/RecentRejectsFilter.adoc[`RecentRejectsFilter`] 
| Lazily construct and return the recently&hyphen;rejected transactions filter&period;
| xref:node/TxDownloadManagerImpl/RecentRejectsReconsiderableFilter.adoc[`RecentRejectsReconsiderableFilter`] 
| Lazily construct and return the reconsiderable&hyphen;rejects filter&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:node/TxDownloadManagerImpl/m_lazy_recent_confirmed_transactions.adoc[`m&lowbar;lazy&lowbar;recent&lowbar;confirmed&lowbar;transactions`] 
| Filter for transactions that have been recently confirmed&period; We use this to avoid requesting transactions that have already been confirmed&period;
| xref:node/TxDownloadManagerImpl/m_lazy_recent_rejects.adoc[`m&lowbar;lazy&lowbar;recent&lowbar;rejects`] 
| Filter for transactions that were recently rejected by the mempool&period; These are not rerequested until the chain tip changes, at which point the entire filter is reset&period;
| xref:node/TxDownloadManagerImpl/m_lazy_recent_rejects_reconsiderable.adoc[`m&lowbar;lazy&lowbar;recent&lowbar;rejects&lowbar;reconsiderable`] 
| Filter for&colon; (1) wtxids of transactions that were recently rejected by the mempool but are eligible for reconsideration if submitted with other transactions&period; (2) packages (see GetPackageHash) we have already rejected before and should not retry&period;
| xref:node/TxDownloadManagerImpl/m_mempool.adoc[`m&lowbar;mempool`] 
| Read&hyphen;only reference to the node&apos;s mempool&period;
| xref:node/TxDownloadManagerImpl/m_num_wtxid_peers.adoc[`m&lowbar;num&lowbar;wtxid&lowbar;peers`] 
| Number of wtxid relay peers we have in m&lowbar;peer&lowbar;info&period;
| xref:node/TxDownloadManagerImpl/m_orphanage.adoc[`m&lowbar;orphanage`] 
| Manages unvalidated tx data (orphan transactions for which we are downloading ancestors)&period;
| xref:node/TxDownloadManagerImpl/m_peer_info.adoc[`m&lowbar;peer&lowbar;info`] 
| Information for all of the peers we may download transactions from&period; This is not necessarily all peers we are connected to (no block&hyphen;relay&hyphen;only and temporary connections)&period;
| xref:node/TxDownloadManagerImpl/m_rng.adoc[`m&lowbar;rng`] 
| Random context used for request scheduling and shuffling&period;
| xref:node/TxDownloadManagerImpl/m_txrequest.adoc[`m&lowbar;txrequest`] 
| Tracks candidates for requesting and downloading transaction data&period;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:node/TxDownloadManagerImpl/GetUniqueParents.adoc[`GetUniqueParents`] 
| Helper for getting deduplicated vector of Txids in vin&period;
| xref:node/TxDownloadManagerImpl/MaybeAddOrphanResolutionCandidate.adoc[`MaybeAddOrphanResolutionCandidate`] 
| If this peer is an orphan resolution candidate for this transaction, treat the unique&lowbar;parents as announced by this peer&semi; add them as new invs to m&lowbar;txrequest&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
