mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Merge #12127: Remove unused mempool index
8e617e3
Remove unused mempool index (Suhas Daftuar)
Pull request description:
We haven't used the "mining_score" index since 0.12, so remove it.
Tree-SHA512: ae37b8663194986eaeecfc2bbeca7ecb4ae6f0d8384515fa218cbc939a580d4b9f7f997c5297c3f1b3c3a0651edb092f373ac9a4808aaec30d38cb99d5f3ed70
This commit is contained in:
parent
923126a663
commit
e158f1ad5b
@ -286,35 +286,6 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
|
||||
|
||||
pool.removeRecursive(pool.mapTx.find(tx9.GetHash())->GetTx());
|
||||
pool.removeRecursive(pool.mapTx.find(tx8.GetHash())->GetTx());
|
||||
/* Now check the sort on the mining score index.
|
||||
* Final order should be:
|
||||
*
|
||||
* tx7 (2M)
|
||||
* tx2 (20k)
|
||||
* tx4 (15000)
|
||||
* tx1/tx5 (10000)
|
||||
* tx3/6 (0)
|
||||
* (Ties resolved by hash)
|
||||
*/
|
||||
sortedOrder.clear();
|
||||
sortedOrder.push_back(tx7.GetHash().ToString());
|
||||
sortedOrder.push_back(tx2.GetHash().ToString());
|
||||
sortedOrder.push_back(tx4.GetHash().ToString());
|
||||
if (tx1.GetHash() < tx5.GetHash()) {
|
||||
sortedOrder.push_back(tx5.GetHash().ToString());
|
||||
sortedOrder.push_back(tx1.GetHash().ToString());
|
||||
} else {
|
||||
sortedOrder.push_back(tx1.GetHash().ToString());
|
||||
sortedOrder.push_back(tx5.GetHash().ToString());
|
||||
}
|
||||
if (tx3.GetHash() < tx6.GetHash()) {
|
||||
sortedOrder.push_back(tx6.GetHash().ToString());
|
||||
sortedOrder.push_back(tx3.GetHash().ToString());
|
||||
} else {
|
||||
sortedOrder.push_back(tx3.GetHash().ToString());
|
||||
sortedOrder.push_back(tx6.GetHash().ToString());
|
||||
}
|
||||
CheckSort<mining_score>(pool, sortedOrder);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
|
||||
|
@ -1388,8 +1388,8 @@ bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const {
|
||||
|
||||
size_t CTxMemPool::DynamicMemoryUsage() const {
|
||||
LOCK(cs);
|
||||
// Estimate the overhead of mapTx to be 15 pointers + an allocation, as no exact formula for boost::multi_index_contained is implemented.
|
||||
return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + 15 * sizeof(void*)) * mapTx.size() + memusage::DynamicUsage(mapNextTx) + memusage::DynamicUsage(mapDeltas) + memusage::DynamicUsage(mapLinks) + memusage::DynamicUsage(vTxHashes) + cachedInnerUsage;
|
||||
// Estimate the overhead of mapTx to be 12 pointers + an allocation, as no exact formula for boost::multi_index_contained is implemented.
|
||||
return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + 12 * sizeof(void*)) * mapTx.size() + memusage::DynamicUsage(mapNextTx) + memusage::DynamicUsage(mapDeltas) + memusage::DynamicUsage(mapLinks) + memusage::DynamicUsage(vTxHashes) + cachedInnerUsage;
|
||||
}
|
||||
|
||||
void CTxMemPool::RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason) {
|
||||
|
@ -295,7 +295,6 @@ public:
|
||||
// Multi_index tag names
|
||||
struct descendant_score {};
|
||||
struct entry_time {};
|
||||
struct mining_score {};
|
||||
struct ancestor_score {};
|
||||
|
||||
class CBlockPolicyEstimator;
|
||||
@ -362,7 +361,6 @@ public:
|
||||
* - transaction hash
|
||||
* - feerate [we use max(feerate of tx, feerate of tx with all descendants)]
|
||||
* - time in mempool
|
||||
* - mining score (feerate modified by any fee deltas from PrioritiseTransaction)
|
||||
*
|
||||
* Note: the term "descendant" refers to in-mempool transactions that depend on
|
||||
* this one, while "ancestor" refers to in-mempool transactions that a given
|
||||
@ -452,12 +450,6 @@ public:
|
||||
boost::multi_index::identity<CTxMemPoolEntry>,
|
||||
CompareTxMemPoolEntryByEntryTime
|
||||
>,
|
||||
// sorted by score (for mining prioritization)
|
||||
boost::multi_index::ordered_unique<
|
||||
boost::multi_index::tag<mining_score>,
|
||||
boost::multi_index::identity<CTxMemPoolEntry>,
|
||||
CompareTxMemPoolEntryByScore
|
||||
>,
|
||||
// sorted by fee rate with ancestors
|
||||
boost::multi_index::ordered_non_unique<
|
||||
boost::multi_index::tag<ancestor_score>,
|
||||
|
Loading…
Reference in New Issue
Block a user