aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-12-08 10:00:49 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-12-08 10:00:55 +0100
commit84d921e79c738c7959692a4e7a76327469e8cc50 (patch)
treee0889ea5c2d31ff53dca3afdea9245eba6e0191f /src/validation.h
parent099325a7594f8187f9067d5bff8390084cceb9dd (diff)
parentf1f10c0514fe81318c8b064f9dad0e2f9a2cd037 (diff)
Merge bitcoin/bitcoin#23465: Remove CTxMemPool params from ATMP
f1f10c0514fe81318c8b064f9dad0e2f9a2cd037 Remove CTxMemPool params from ATMP (lsilva01) Pull request description: Remove `CTxMemPool` parameter from `AcceptToMemoryPool` function, as suggested in https://github.com/bitcoin/bitcoin/pull/23437#issuecomment-962536149 . This requires that `CChainState` has access to `MockedTxPool` in `tx_pool.cpp` as mentioned https://github.com/bitcoin/bitcoin/pull/23173#discussion_r731895386. So the `MockedTxPool` is attributed to `CChainState::m_mempool` before calling `AcceptToMemoryPool`. Requires #23437. ACKs for top commit: jnewbery: utACK f1f10c0514fe81318c8b064f9dad0e2f9a2cd037 MarcoFalke: review ACK f1f10c0514fe81318c8b064f9dad0e2f9a2cd037 🔙 Tree-SHA512: 2a4885f4645014fc1fa98bb1090f13721c1a0796bc0021b9cb43bc8cc13920b6eaf057d1f5ed796e0a110e7813e41fe0196334ce7c80d1231fc057a9a3bdf349
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/validation.h b/src/validation.h
index 2609538ece..3bb26084f1 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -211,18 +211,16 @@ 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()
*
- * @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.
+ * @param[in] accept_time The timestamp for adding the transaction to the mempool.
* 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(CTxMemPool& pool, CChainState& active_chainstate, const CTransactionRef& tx,
+MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, const CTransactionRef& tx,
int64_t accept_time, bool bypass_limits, bool test_accept)
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
@@ -649,6 +647,12 @@ public:
return m_coins_views->m_dbview;
}
+ //! @returns A pointer to the mempool.
+ CTxMemPool* GetMempool()
+ {
+ return m_mempool;
+ }
+
//! @returns A reference to a wrapped view of the in-memory UTXO set that
//! handles disk read errors gracefully.
CCoinsViewErrorCatcher& CoinsErrorCatcher() EXCLUSIVE_LOCKS_REQUIRED(cs_main)