Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
bool TestSequenceLocks(const CTransaction &tx, int flags) { | bool TestSequenceLocks(const CTransaction &tx, int flags) { | ||||
LOCK(mempool.cs); | LOCK(mempool.cs); | ||||
return CheckSequenceLocks(tx, flags); | return CheckSequenceLocks(tx, flags); | ||||
} | } | ||||
// 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 blockprioritysize is 0. | // Note that this test assumes blockprioritypercentage is 0. | ||||
void TestPackageSelection(const CChainParams &chainparams, CScript scriptPubKey, | void TestPackageSelection(const CChainParams &chainparams, CScript scriptPubKey, | ||||
std::vector<CTransactionRef> &txFirst) { | std::vector<CTransactionRef> &txFirst) { | ||||
// Test the ancestor feerate transaction selection. | // Test the ancestor feerate transaction selection. | ||||
TestMemPoolEntryHelper entry; | TestMemPoolEntryHelper entry; | ||||
GlobalConfig config; | GlobalConfig config; | ||||
// these 3 tests assume blockprioritypercentage is 0. | |||||
config.SetBlockPriorityPercentage(0); | |||||
// 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; | ||||
tx.vin[0].prevout.hash = txFirst[0]->GetId(); | tx.vin[0].prevout.hash = txFirst[0]->GetId(); | ||||
tx.vin[0].prevout.n = 0; | tx.vin[0].prevout.n = 0; | ||||
tx.vout.resize(1); | tx.vout.resize(1); | ||||
▲ Show 20 Lines • Show All 686 Lines • Show Last 20 Lines |