mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
[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:
@@ -3421,6 +3421,17 @@ bool ChainstateManager::ProcessNewBlock(const CChainParams& chainparams, const s
|
||||
return true;
|
||||
}
|
||||
|
||||
MempoolAcceptResult ChainstateManager::ProcessTransaction(const CTransactionRef& tx, bool test_accept)
|
||||
{
|
||||
CChainState& active_chainstate = ActiveChainstate();
|
||||
if (!active_chainstate.m_mempool) {
|
||||
TxValidationState state;
|
||||
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);
|
||||
}
|
||||
|
||||
bool TestBlockValidity(BlockValidationState& state,
|
||||
const CChainParams& chainparams,
|
||||
CChainState& chainstate,
|
||||
|
||||
Reference in New Issue
Block a user