Changeset View
Changeset View
Standalone View
Standalone View
src/test/txvalidationcache_tests.cpp
Show All 23 Lines | |||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
BOOST_AUTO_TEST_SUITE(txvalidationcache_tests) | BOOST_AUTO_TEST_SUITE(txvalidationcache_tests) | ||||
static bool ToMemPool(const CMutableTransaction &tx) { | static bool ToMemPool(const CMutableTransaction &tx) { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
CValidationState state; | CValidationState state; | ||||
return AcceptToMemoryPool(GetConfig(), g_mempool, state, | return AcceptToMemoryPool( | ||||
MakeTransactionRef(tx), false, nullptr, true, | GetConfig(), g_mempool, state, MakeTransactionRef(tx), | ||||
Amount::zero()); | nullptr /* pfMissingInputs */, true /* bypass_limits */, | ||||
Amount::zero() /* nAbsurdFee */); | |||||
} | } | ||||
BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) { | BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) { | ||||
// Make sure skipping validation of transactions that were validated going | // Make sure skipping validation of transactions that were validated going | ||||
// into the memory pool does not allow double-spends in blocks to pass | // into the memory pool does not allow double-spends in blocks to pass | ||||
// validation when they should not. | // validation when they should not. | ||||
CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) | CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) | ||||
<< OP_CHECKSIG; | << OP_CHECKSIG; | ||||
▲ Show 20 Lines • Show All 403 Lines • Show Last 20 Lines |