Changeset View
Changeset View
Standalone View
Standalone View
src/test/policyestimator_tests.cpp
Show All 34 Lines | BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) { | ||||
CScript garbage; | CScript garbage; | ||||
for (unsigned int i = 0; i < 128; i++) | for (unsigned int i = 0; i < 128; i++) | ||||
garbage.push_back('X'); | garbage.push_back('X'); | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
tx.vin.resize(1); | tx.vin.resize(1); | ||||
tx.vin[0].scriptSig = garbage; | tx.vin[0].scriptSig = garbage; | ||||
tx.vout.resize(1); | tx.vout.resize(1); | ||||
tx.vout[0].nValue = Amount(0); | tx.vout[0].nValue = Amount(0); | ||||
CFeeRate baseRate(basefee, GetTransactionSize(tx)); | CFeeRate baseRate(basefee, CTransaction(tx).GetTotalSize()); | ||||
// Create a fake block | // Create a fake block | ||||
std::vector<CTransactionRef> block; | std::vector<CTransactionRef> block; | ||||
int blocknum = 0; | int blocknum = 0; | ||||
// Loop through 200 blocks | // Loop through 200 blocks | ||||
// At a decay .998 and 4 fee transactions per block | // At a decay .998 and 4 fee transactions per block | ||||
// This makes the tx count about 1.33 per bucket, above the 1 threshold | // This makes the tx count about 1.33 per bucket, above the 1 threshold | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |