aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-09-27 18:11:08 +0100
committerJohn Newbery <john@johnnewbery.com>2021-11-03 14:37:45 +0000
commit0fdb619aaf1d62598263361a6082d182be1af792 (patch)
tree4c09bbc8b3b74e992e0a311d6ed2621e1e55c39c /src/net_processing.cpp
parent2c64270bbe523ef87e7225c351464e7c716f0b3e (diff)
[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/net_processing.cpp')
-rw-r--r--src/net_processing.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 7e35f1f9e6..2185ccc700 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2300,8 +2300,6 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set)
break;
}
}
- CChainState& active_chainstate = m_chainman.ActiveChainstate();
- m_mempool.check(active_chainstate.CoinsTip(), active_chainstate.m_chain.Height() + 1);
}
bool PeerManagerImpl::PrepareBlockFilterRequest(CNode& peer,
@@ -3264,8 +3262,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
const TxValidationState& state = result.m_state;
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
- CChainState& active_chainstate = m_chainman.ActiveChainstate();
- m_mempool.check(active_chainstate.CoinsTip(), active_chainstate.m_chain.Height() + 1);
// As this version of the transaction was acceptable, we can forget about any
// requests for it.
m_txrequest.ForgetTxHash(tx.GetHash());