[validation] Add CChainState::ProcessTransaction()

This just calls through to AcceptToMemoryPool() internally, and is currently unused.

Also add a new transaction validation failure reason TX_NO_MEMPOOL to
indicate that there is no mempool.
This commit is contained in:
John Newbery
2021-09-27 16:55:42 +01:00
parent 36167faea9
commit 92a3aeecf6
4 changed files with 22 additions and 0 deletions

View File

@@ -994,6 +994,15 @@ public:
*/
bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& block, BlockValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex = nullptr) LOCKS_EXCLUDED(cs_main);
/**
* Try to add a transaction to the memory pool.
*
* @param[in] tx The transaction to submit for mempool acceptance.
* @param[in] test_accept When true, run validation checks but don't submit to mempool.
*/
[[nodiscard]] MempoolAcceptResult ProcessTransaction(const CTransactionRef& tx, bool test_accept=false)
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
//! Load the block tree and coins database from disk, initializing state if we're running with -reindex
bool LoadBlockIndex() EXCLUSIVE_LOCKS_REQUIRED(cs_main);