Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show First 20 Lines • Show All 365 Lines • ▼ Show 20 Lines | for (unsigned int i = 0; i < 1001; ++i) { | ||||
const TxId txid = tx.GetId(); | const TxId txid = tx.GetId(); | ||||
// Only first tx spends coinbase. | // Only first tx spends coinbase. | ||||
bool spendsCoinbase = i == 0; | bool spendsCoinbase = i == 0; | ||||
// If we do set the # of sig ops in the CTxMemPoolEntry, template | // If we do set the # of sig ops in the CTxMemPoolEntry, template | ||||
// creation passes. | // creation passes. | ||||
g_mempool.addUnchecked(txid, entry.Fee(LOWFEE) | g_mempool.addUnchecked(txid, entry.Fee(LOWFEE) | ||||
.Time(GetTime()) | .Time(GetTime()) | ||||
.SpendsCoinbase(spendsCoinbase) | .SpendsCoinbase(spendsCoinbase) | ||||
.SigOpsCost(80) | .SigOpCount(20) | ||||
.FromTx(tx)); | .FromTx(tx)); | ||||
tx.vin[0].prevout = COutPoint(txid, 0); | tx.vin[0].prevout = COutPoint(txid, 0); | ||||
} | } | ||||
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams, g_mempool) | BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams, g_mempool) | ||||
.CreateNewBlock(scriptPubKey)); | .CreateNewBlock(scriptPubKey)); | ||||
g_mempool.clear(); | g_mempool.clear(); | ||||
▲ Show 20 Lines • Show All 404 Lines • Show Last 20 Lines |