Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | void MinerTestingSetup::TestPackageSelection( | ||||
for (const auto &txn : pblocktemplate->block.vtx) { | for (const auto &txn : pblocktemplate->block.vtx) { | ||||
BOOST_CHECK(txn->GetId() != freeTxId); | BOOST_CHECK(txn->GetId() != freeTxId); | ||||
BOOST_CHECK(txn->GetId() != lowFeeTxId); | BOOST_CHECK(txn->GetId() != lowFeeTxId); | ||||
} | } | ||||
// Test that packages above the min relay fee do get included, even if one | // Test that packages above the min relay fee do get included, even if one | ||||
// of the transactions is below the min relay fee. Remove the low fee | // of the transactions is below the min relay fee. Remove the low fee | ||||
// transaction and replace with a higher fee transaction | // transaction and replace with a higher fee transaction | ||||
m_node.mempool->removeRecursive(CTransaction(tx)); | m_node.mempool->removeRecursive(CTransaction(tx), | ||||
MemPoolRemovalReason::REPLACED); | |||||
// Now we should be just over the min relay fee. | // Now we should be just over the min relay fee. | ||||
tx.vout[0].nValue -= 2 * SATOSHI; | tx.vout[0].nValue -= 2 * SATOSHI; | ||||
lowFeeTxId = tx.GetId(); | lowFeeTxId = tx.GetId(); | ||||
m_node.mempool->addUnchecked(entry.Fee(feeToUse + 2 * SATOSHI).FromTx(tx)); | m_node.mempool->addUnchecked(entry.Fee(feeToUse + 2 * SATOSHI).FromTx(tx)); | ||||
pblocktemplate = AssemblerForTest(chainparams, *m_node.mempool) | pblocktemplate = AssemblerForTest(chainparams, *m_node.mempool) | ||||
.CreateNewBlock(scriptPubKey); | .CreateNewBlock(scriptPubKey); | ||||
BOOST_CHECK(pblocktemplate->block.vtx[4]->GetId() == freeTxId); | BOOST_CHECK(pblocktemplate->block.vtx[4]->GetId() == freeTxId); | ||||
BOOST_CHECK(pblocktemplate->block.vtx[5]->GetId() == lowFeeTxId); | BOOST_CHECK(pblocktemplate->block.vtx[5]->GetId() == lowFeeTxId); | ||||
▲ Show 20 Lines • Show All 557 Lines • Show Last 20 Lines |