Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
// Test suite for ancestor feerate transaction selection. | // Test suite for ancestor feerate transaction selection. | ||||
// Implemented as an additional function, rather than a separate test case, to | // Implemented as an additional function, rather than a separate test case, to | ||||
// allow reusing the blockchain created in CreateNewBlock_validity. | // allow reusing the blockchain created in CreateNewBlock_validity. | ||||
// Note that this test assumes blockprioritypercentage is 0. | // Note that this test assumes blockprioritypercentage is 0. | ||||
static void TestPackageSelection(const CChainParams &chainparams, | static void TestPackageSelection(const CChainParams &chainparams, | ||||
const CScript &scriptPubKey, | const CScript &scriptPubKey, | ||||
const std::vector<CTransactionRef> &txFirst) | const std::vector<CTransactionRef> &txFirst) | ||||
EXCLUSIVE_LOCKS_REQUIRED(::g_mempool.cs) { | EXCLUSIVE_LOCKS_REQUIRED(cs_main, ::g_mempool.cs) { | ||||
// Test the ancestor feerate transaction selection. | // Test the ancestor feerate transaction selection. | ||||
TestMemPoolEntryHelper entry; | TestMemPoolEntryHelper entry; | ||||
// Test that a medium fee transaction will be selected after a higher fee | // Test that a medium fee transaction will be selected after a higher fee | ||||
// rate package with a low fee rate parent. | // rate package with a low fee rate parent. | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
tx.vin.resize(1); | tx.vin.resize(1); | ||||
tx.vin[0].scriptSig = CScript() << OP_1; | tx.vin[0].scriptSig = CScript() << OP_1; | ||||
▲ Show 20 Lines • Show All 673 Lines • Show Last 20 Lines |