Skip to content

Commit f150fb9

Browse files
committed
[refactor] make AlreadyHaveTx and Find1P1CPackage private to TxDownloadImpl
1 parent 1e08195 commit f150fb9

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

src/node/txdownloadman.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,6 @@ class TxDownloadManager {
131131
void BlockConnected(const std::shared_ptr<const CBlock>& pblock);
132132
void BlockDisconnected();
133133

134-
/** Check whether we already have this gtxid in:
135-
* - mempool
136-
* - orphanage
137-
* - m_recent_rejects
138-
* - m_recent_rejects_reconsiderable (if include_reconsiderable = true)
139-
* - m_recent_confirmed_transactions
140-
* */
141-
bool AlreadyHaveTx(const GenTxid& gtxid, bool include_reconsiderable);
142-
143134
/** Creates a new PeerInfo. Saves the connection info to calculate tx announcement delays later. */
144135
void ConnectedPeer(NodeId nodeid, const TxDownloadConnectionInfo& info);
145136

@@ -157,11 +148,6 @@ class TxDownloadManager {
157148
/** Should be called when a notfound for a tx has been received. */
158149
void ReceivedNotFound(NodeId nodeid, const std::vector<uint256>& txhashes);
159150

160-
/** Look for a child of this transaction in the orphanage to form a 1-parent-1-child package,
161-
* skipping any combinations that have already been tried. Return the resulting package along with
162-
* the senders of its respective transactions, or std::nullopt if no package is found. */
163-
std::optional<PackageToValidate> Find1P1CPackage(const CTransactionRef& ptx, NodeId nodeid);
164-
165151
/** Respond to successful transaction submission to mempool */
166152
void MempoolAcceptedTx(const CTransactionRef& tx);
167153

src/node/txdownloadman_impl.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ void TxDownloadManager::BlockDisconnected()
3939
{
4040
m_impl->BlockDisconnected();
4141
}
42-
bool TxDownloadManager::AlreadyHaveTx(const GenTxid& gtxid, bool include_reconsiderable)
43-
{
44-
return m_impl->AlreadyHaveTx(gtxid, include_reconsiderable);
45-
}
4642
void TxDownloadManager::ConnectedPeer(NodeId nodeid, const TxDownloadConnectionInfo& info)
4743
{
4844
m_impl->ConnectedPeer(nodeid, info);
@@ -63,10 +59,6 @@ void TxDownloadManager::ReceivedNotFound(NodeId nodeid, const std::vector<uint25
6359
{
6460
m_impl->ReceivedNotFound(nodeid, txhashes);
6561
}
66-
std::optional<PackageToValidate> TxDownloadManager::Find1P1CPackage(const CTransactionRef& ptx, NodeId nodeid)
67-
{
68-
return m_impl->Find1P1CPackage(ptx, nodeid);
69-
}
7062
void TxDownloadManager::MempoolAcceptedTx(const CTransactionRef& tx)
7163
{
7264
m_impl->MempoolAcceptedTx(tx);

src/node/txdownloadman_impl.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ class TxDownloadManagerImpl {
148148
void BlockConnected(const std::shared_ptr<const CBlock>& pblock);
149149
void BlockDisconnected();
150150

151+
/** Check whether we already have this gtxid in:
152+
* - mempool
153+
* - orphanage
154+
* - m_recent_rejects
155+
* - m_recent_rejects_reconsiderable (if include_reconsiderable = true)
156+
* - m_recent_confirmed_transactions
157+
* */
151158
bool AlreadyHaveTx(const GenTxid& gtxid, bool include_reconsiderable);
152159

153160
void ConnectedPeer(NodeId nodeid, const TxDownloadConnectionInfo& info);
@@ -162,6 +169,9 @@ class TxDownloadManagerImpl {
162169
/** Marks a tx as ReceivedResponse in txrequest. */
163170
void ReceivedNotFound(NodeId nodeid, const std::vector<uint256>& txhashes);
164171

172+
/** Look for a child of this transaction in the orphanage to form a 1-parent-1-child package,
173+
* skipping any combinations that have already been tried. Return the resulting package along with
174+
* the senders of its respective transactions, or std::nullopt if no package is found. */
165175
std::optional<PackageToValidate> Find1P1CPackage(const CTransactionRef& ptx, NodeId nodeid);
166176

167177
void MempoolAcceptedTx(const CTransactionRef& tx);

0 commit comments

Comments
 (0)