aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-09-27 16:55:42 +0100
committerJohn Newbery <john@johnnewbery.com>2021-11-03 14:34:38 +0000
commit92a3aeecf6a82e9cbc9fda11022b0548efd24d05 (patch)
treeb7767b17918c211b159097329950a8f5d2bc6b4b /src/validation.h
parent36167faea92c97ddea7403280a5074073c8e5f90 (diff)
downloadbitcoin-92a3aeecf6a82e9cbc9fda11022b0548efd24d05.tar.xz
[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.
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h
index 4da8ec8d24..096e609abe 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -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);