mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-13 14:14:00 +01:00
[refactor] move invalid package processing to TxDownload
This commit is contained in:
@@ -168,6 +168,9 @@ public:
|
||||
|
||||
/** Respond to transaction rejected from mempool */
|
||||
RejectedTxTodo MempoolRejectedTx(const CTransactionRef& ptx, const TxValidationState& state, NodeId nodeid, bool first_time_failure);
|
||||
|
||||
/** Respond to package rejected from mempool */
|
||||
void MempoolRejectedPackage(const Package& package);
|
||||
};
|
||||
} // namespace node
|
||||
#endif // BITCOIN_NODE_TXDOWNLOADMAN_H
|
||||
|
||||
@@ -79,6 +79,10 @@ RejectedTxTodo TxDownloadManager::MempoolRejectedTx(const CTransactionRef& ptx,
|
||||
{
|
||||
return m_impl->MempoolRejectedTx(ptx, state, nodeid, first_time_failure);
|
||||
}
|
||||
void TxDownloadManager::MempoolRejectedPackage(const Package& package)
|
||||
{
|
||||
m_impl->MempoolRejectedPackage(package);
|
||||
}
|
||||
|
||||
// TxDownloadManagerImpl
|
||||
void TxDownloadManagerImpl::ActiveTipChange()
|
||||
@@ -441,4 +445,9 @@ node::RejectedTxTodo TxDownloadManagerImpl::MempoolRejectedTx(const CTransaction
|
||||
.m_package_to_validate = std::move(package_to_validate)
|
||||
};
|
||||
}
|
||||
|
||||
void TxDownloadManagerImpl::MempoolRejectedPackage(const Package& package)
|
||||
{
|
||||
RecentRejectsReconsiderableFilter().insert(GetPackageHash(package));
|
||||
}
|
||||
} // namespace node
|
||||
|
||||
@@ -166,6 +166,7 @@ public:
|
||||
|
||||
void MempoolAcceptedTx(const CTransactionRef& tx);
|
||||
RejectedTxTodo MempoolRejectedTx(const CTransactionRef& ptx, const TxValidationState& state, NodeId nodeid, bool first_time_failure);
|
||||
void MempoolRejectedPackage(const Package& package);
|
||||
};
|
||||
} // namespace node
|
||||
#endif // BITCOIN_NODE_TXDOWNLOADMAN_IMPL_H
|
||||
|
||||
Reference in New Issue
Block a user