Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | void TestPackageSelection(const CChainParams &chainparams, CScript scriptPubKey, | ||||
BOOST_CHECK(pblocktemplate->block.vtx[5]->GetId() == hashLowFeeTx); | BOOST_CHECK(pblocktemplate->block.vtx[5]->GetId() == hashLowFeeTx); | ||||
// Test that transaction selection properly updates ancestor fee | // Test that transaction selection properly updates ancestor fee | ||||
// calculations as ancestor transactions get included in a block. Add a | // calculations as ancestor transactions get included in a block. Add a | ||||
// 0-fee transaction that has 2 outputs. | // 0-fee transaction that has 2 outputs. | ||||
tx.vin[0].prevout.hash = txFirst[2]->GetId(); | tx.vin[0].prevout.hash = txFirst[2]->GetId(); | ||||
tx.vout.resize(2); | tx.vout.resize(2); | ||||
tx.vout[0].nValue = 5000000000LL - 100000000; | tx.vout[0].nValue = 5000000000LL - 100000000; | ||||
// 1BCC output. | // 1BCH output. | ||||
tx.vout[1].nValue = 100000000; | tx.vout[1].nValue = 100000000; | ||||
uint256 hashFreeTx2 = tx.GetId(); | uint256 hashFreeTx2 = tx.GetId(); | ||||
mempool.addUnchecked(hashFreeTx2, | mempool.addUnchecked(hashFreeTx2, | ||||
entry.Fee(0).SpendsCoinbase(true).FromTx(tx)); | entry.Fee(0).SpendsCoinbase(true).FromTx(tx)); | ||||
// This tx can't be mined by itself. | // This tx can't be mined by itself. | ||||
tx.vin[0].prevout.hash = hashFreeTx2; | tx.vin[0].prevout.hash = hashFreeTx2; | ||||
tx.vout.resize(1); | tx.vout.resize(1); | ||||
▲ Show 20 Lines • Show All 599 Lines • Show Last 20 Lines |