diff options
author | John Newbery <john@johnnewbery.com> | 2021-09-27 18:11:08 +0100 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2021-11-03 14:37:45 +0000 |
commit | 0fdb619aaf1d62598263361a6082d182be1af792 (patch) | |
tree | 4c09bbc8b3b74e992e0a311d6ed2621e1e55c39c /src/validation.cpp | |
parent | 2c64270bbe523ef87e7225c351464e7c716f0b3e (diff) | |
download | bitcoin-0fdb619aaf1d62598263361a6082d182be1af792.tar.xz |
[validation] Always call mempool.check() after processing a new transaction
CTxMemPool::check() will carry out internal consistency checks 1/n times,
where n is set by the `-checkmempool` configuration option. By default,
mempool consistency checks are disabled entirely on mainnet.
Therefore, this change has no effect on mainnet nodes running with
default configuration. It simply removes the responsibility to trigger
mempool consistency checks from net_processing.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 1947f5d9c3..79ef6a6b19 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3429,7 +3429,9 @@ MempoolAcceptResult ChainstateManager::ProcessTransaction(const CTransactionRef& state.Invalid(TxValidationResult::TX_NO_MEMPOOL, "no-mempool"); return MempoolAcceptResult::Failure(state); } - return AcceptToMemoryPool(active_chainstate, *active_chainstate.m_mempool, tx, /*bypass_limits=*/ false, test_accept); + auto result = AcceptToMemoryPool(active_chainstate, *active_chainstate.m_mempool, tx, /*bypass_limits=*/ false, test_accept); + active_chainstate.m_mempool->check(active_chainstate.CoinsTip(), active_chainstate.m_chain.Height() + 1); + return result; } bool TestBlockValidity(BlockValidationState& state, |