Remove AcceptToMemoryPoolWithTime

This commit is contained in:
lsilva01
2021-11-03 22:23:38 -03:00
parent e7507f333b
commit 9360778d6e
3 changed files with 26 additions and 29 deletions

View File

@@ -208,19 +208,23 @@ struct PackageMempoolAcceptResult
};
/**
* Try to add a transaction to the mempool. This is an internal function and is
* exposed only for testing. Client code should use ChainstateManager::ProcessTransaction()
* Try to add a transaction to the mempool. This is an internal function and is exposed only for testing.
* Client code should use ChainstateManager::ProcessTransaction()
*
* @param[in] active_chainstate Reference to the active chainstate.
* @param[in] pool Reference to the node's mempool.
* @param[in] active_chainstate Reference to the active chainstate.
* @param[in] tx The transaction to submit for mempool acceptance.
* @param[in] accept_time The timestamp for adding the transaction to the mempool. Usually
* the current system time, but may be different.
* It is also used to determine when the entry expires.
* @param[in] bypass_limits When true, don't enforce mempool fee and capacity limits.
* @param[in] test_accept When true, run validation checks but don't submit to mempool.
*
* @returns a MempoolAcceptResult indicating whether the transaction was accepted/rejected with reason.
*/
MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, CTxMemPool& pool, const CTransactionRef& tx,
bool bypass_limits, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
MempoolAcceptResult AcceptToMemoryPool(CTxMemPool& pool, CChainState& active_chainstate, const CTransactionRef& tx,
int64_t accept_time, bool bypass_limits, bool test_accept)
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
/**
* Atomically test acceptance of a package. If the package only contains one tx, package rules still
@@ -581,8 +585,6 @@ protected:
//! Only the active chainstate has a mempool.
CTxMemPool* m_mempool;
const CChainParams& m_params;
//! Manages the UTXO set, which is a reflection of the contents of `m_chain`.
std::unique_ptr<CoinsViews> m_coins_views;
@@ -591,6 +593,9 @@ public:
//! CChainState instances.
BlockManager& m_blockman;
/** Chain parameters for this chainstate */
const CChainParams& m_params;
//! The chainstate manager that owns this chainstate. The reference is
//! necessary so that this instance can check whether it is the active
//! chainstate within deeply nested method calls.