[refactor] return MempoolAcceptResult

This creates a cleaner interface with ATMP, allows us to make results const,
and makes accessing values that don't make sense (e.g. fee when tx is
invalid) an error.
This commit is contained in:
gzhao408
2021-01-19 05:29:40 -08:00
parent 9db10a5506
commit f82baf0762
9 changed files with 106 additions and 92 deletions

View File

@@ -283,15 +283,9 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
// Add the txs to the tx pool
{
LOCK(cs_main);
TxValidationState state;
std::list<CTransactionRef> plTxnReplaced;
for (const auto& tx : txs) {
BOOST_REQUIRE(AcceptToMemoryPool(
*m_node.mempool,
state,
tx,
&plTxnReplaced,
/* bypass_limits */ false));
const MempoolAcceptResult result = AcceptToMemoryPool(*m_node.mempool, tx, false /* bypass_limits */);
BOOST_REQUIRE(result.m_result_type == MempoolAcceptResult::ResultType::VALID);
}
}