Changeset View
Changeset View
Standalone View
Standalone View
src/test/txvalidation_tests.cpp
Show All 33 Lines | BOOST_FIXTURE_TEST_CASE(tx_mempool_reject_coinbase, TestChain100Setup) { | ||||
coinbaseTx.vout[0].nValue = 1 * CENT; | coinbaseTx.vout[0].nValue = 1 * CENT; | ||||
coinbaseTx.vout[0].scriptPubKey = scriptPubKey; | coinbaseTx.vout[0].scriptPubKey = scriptPubKey; | ||||
BOOST_CHECK(CTransaction(coinbaseTx).IsCoinBase()); | BOOST_CHECK(CTransaction(coinbaseTx).IsCoinBase()); | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
unsigned int initialPoolSize = m_node.mempool->size(); | unsigned int initialPoolSize = m_node.mempool->size(); | ||||
const MempoolAcceptResult result = AcceptToMemoryPool( | const MempoolAcceptResult result = | ||||
m_node.chainman->ActiveChainstate(), GetConfig(), *m_node.mempool, | m_node.chainman->ProcessTransaction(MakeTransactionRef(coinbaseTx)); | ||||
MakeTransactionRef(coinbaseTx), false /* bypass_limits */); | |||||
BOOST_CHECK(result.m_result_type == | BOOST_CHECK(result.m_result_type == | ||||
MempoolAcceptResult::ResultType::INVALID); | MempoolAcceptResult::ResultType::INVALID); | ||||
// Check that the transaction hasn't been added to mempool. | // Check that the transaction hasn't been added to mempool. | ||||
BOOST_CHECK_EQUAL(m_node.mempool->size(), initialPoolSize); | BOOST_CHECK_EQUAL(m_node.mempool->size(), initialPoolSize); | ||||
// Check that the validation state reflects the unsuccesful attempt. | // Check that the validation state reflects the unsuccesful attempt. | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |