Changeset View
Changeset View
Standalone View
Standalone View
src/test/mempool_tests.cpp
Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | static void CheckSort(CTxMemPool &pool, std::vector<std::string> &sortedOrder, | ||||
} | } | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(MempoolIndexingTest) { | BOOST_AUTO_TEST_CASE(MempoolIndexingTest) { | ||||
CTxMemPool pool; | CTxMemPool pool; | ||||
LOCK2(cs_main, pool.cs); | LOCK2(cs_main, pool.cs); | ||||
TestMemPoolEntryHelper entry; | TestMemPoolEntryHelper entry; | ||||
/* Remove the default nonzero sigops, since the below tests are focussing on | |||||
* fee-based ordering and involve some artificially very tiny 21-byte | |||||
* transactions without any inputs. */ | |||||
entry.SigOpCount(0); | |||||
/* 3rd highest fee */ | /* 3rd highest fee */ | ||||
CMutableTransaction tx1 = CMutableTransaction(); | CMutableTransaction tx1 = CMutableTransaction(); | ||||
tx1.vout.resize(1); | tx1.vout.resize(1); | ||||
tx1.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | tx1.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | ||||
tx1.vout[0].nValue = 10 * COIN; | tx1.vout[0].nValue = 10 * COIN; | ||||
pool.addUnchecked(tx1.GetId(), entry.Fee(10000 * SATOSHI).FromTx(tx1)); | pool.addUnchecked(tx1.GetId(), entry.Fee(10000 * SATOSHI).FromTx(tx1)); | ||||
/* highest fee */ | /* highest fee */ | ||||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(MempoolIndexingTest) { | ||||
pool.removeRecursive(pool.mapTx.find(tx8.GetId())->GetTx()); | pool.removeRecursive(pool.mapTx.find(tx8.GetId())->GetTx()); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest) { | BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest) { | ||||
CTxMemPool pool; | CTxMemPool pool; | ||||
LOCK2(cs_main, pool.cs); | LOCK2(cs_main, pool.cs); | ||||
TestMemPoolEntryHelper entry; | TestMemPoolEntryHelper entry; | ||||
/* Remove the default nonzero sigops, since the below tests are focussing on | |||||
* fee-based ordering and involve some artificially very tiny 21-byte | |||||
* transactions without any inputs. */ | |||||
entry.SigOpCount(0); | |||||
/* 3rd highest fee */ | /* 3rd highest fee */ | ||||
CMutableTransaction tx1 = CMutableTransaction(); | CMutableTransaction tx1 = CMutableTransaction(); | ||||
tx1.vout.resize(1); | tx1.vout.resize(1); | ||||
tx1.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | tx1.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | ||||
tx1.vout[0].nValue = 10 * COIN; | tx1.vout[0].nValue = 10 * COIN; | ||||
pool.addUnchecked(tx1.GetId(), entry.Fee(10000 * SATOSHI).FromTx(tx1)); | pool.addUnchecked(tx1.GetId(), entry.Fee(10000 * SATOSHI).FromTx(tx1)); | ||||
/* highest fee */ | /* highest fee */ | ||||
▲ Show 20 Lines • Show All 570 Lines • Show Last 20 Lines |