mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-28 16:36:04 +01:00
[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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user