Changeset View
Changeset View
Standalone View
Standalone View
src/test/txvalidationcache_tests.cpp
Show All 29 Lines | static bool ToMemPool(const CMutableTransaction &tx) { | ||||
CValidationState state; | CValidationState state; | ||||
return AcceptToMemoryPool(GetConfig(), g_mempool, state, | return AcceptToMemoryPool(GetConfig(), g_mempool, state, | ||||
MakeTransactionRef(tx), false, nullptr, true, | MakeTransactionRef(tx), false, nullptr, true, | ||||
Amount::zero()); | Amount::zero()); | ||||
} | } | ||||
BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) { | BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) { | ||||
// Make sure skipping validation of transctions 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; | ||||
// Create a double-spend of mature coinbase txn: | // Create a double-spend of mature coinbase txn: | ||||
std::vector<CMutableTransaction> spends; | std::vector<CMutableTransaction> spends; | ||||
spends.resize(2); | spends.resize(2); | ||||
▲ Show 20 Lines • Show All 392 Lines • Show Last 20 Lines |