Skip to content

Commit 46d955d

Browse files
committed
Remove mapLinks in favor of entry inlined structs with iterator type erasure
1 parent 23d3ae7 commit 46d955d

File tree

5 files changed

+128
-112
lines changed

5 files changed

+128
-112
lines changed

src/miner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct CompareTxIterByAncestorCount {
8484
{
8585
if (a->GetCountWithAncestors() != b->GetCountWithAncestors())
8686
return a->GetCountWithAncestors() < b->GetCountWithAncestors();
87-
return CTxMemPool::CompareIteratorByHash()(a, b);
87+
return CompareIteratorByHash()(a, b);
8888
}
8989
};
9090

src/net_processing.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,11 +1776,11 @@ void static ProcessGetData(CNode& pfrom, const CChainParams& chainparams, CConnm
17761776
LOCK(mempool.cs);
17771777
auto txiter = mempool.GetIter(tx->GetHash());
17781778
if (txiter) {
1779-
const CTxMemPool::setEntries& parents = mempool.GetMemPoolParents(*txiter);
1779+
const CTxMemPoolEntry::Parents& parents = (*txiter)->GetMemPoolParentsConst();
17801780
parent_ids_to_add.reserve(parents.size());
1781-
for (CTxMemPool::txiter parent_iter : parents) {
1782-
if (parent_iter->GetTime() > now - UNCONDITIONAL_RELAY_DELAY) {
1783-
parent_ids_to_add.push_back(parent_iter->GetTx().GetHash());
1781+
for (const CTxMemPoolEntry& parent : parents) {
1782+
if (parent.GetTime() > now - UNCONDITIONAL_RELAY_DELAY) {
1783+
parent_ids_to_add.push_back(parent.GetTx().GetHash());
17841784
}
17851785
}
17861786
}

src/rpc/blockchain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,9 @@ static void entryToJSON(const CTxMemPool& pool, UniValue& info, const CTxMemPool
463463

464464
UniValue spent(UniValue::VARR);
465465
const CTxMemPool::txiter& it = pool.mapTx.find(tx.GetHash());
466-
const CTxMemPool::setEntries& setChildren = pool.GetMemPoolChildren(it);
467-
for (CTxMemPool::txiter childiter : setChildren) {
468-
spent.push_back(childiter->GetTx().GetHash().ToString());
466+
const CTxMemPoolEntry::Children& children = it->GetMemPoolChildrenConst();
467+
for (const CTxMemPoolEntry& child : children) {
468+
spent.push_back(child.GetTx().GetHash().ToString());
469469
}
470470

471471
info.pushKV("spentby", spent);

0 commit comments

Comments
 (0)