Rewrite GetChildren without sets

This commit is contained in:
Suhas Daftuar committed 2025-11-30 11:02:08 -05:00
1 parent 3e39ea8c30
commit 9292570f4c
1 file changed
+4 -5
+4 -5
View File
@@ -58,13 +58,12 @@ std::vector<CTxMemPoolEntry::CTxMemPoolEntryRef> CTxMemPool::GetChildren(const C
{ {
LOCK(cs); LOCK(cs);
std::vector<CTxMemPoolEntry::CTxMemPoolEntryRef> ret; std::vector<CTxMemPoolEntry::CTxMemPoolEntryRef> ret;
setEntries children; WITH_FRESH_EPOCH(m_epoch);
auto iter = mapNextTx.lower_bound(COutPoint(entry.GetTx().GetHash(), 0)); auto iter = mapNextTx.lower_bound(COutPoint(entry.GetTx().GetHash(), 0));
for (; iter != mapNextTx.end() && iter->first->hash == entry.GetTx().GetHash(); ++iter) { for (; iter != mapNextTx.end() && iter->first->hash == entry.GetTx().GetHash(); ++iter) {
children.insert(iter->second); if (!visited(iter->second)) {
} ret.emplace_back(*(iter->second));
for (const auto& child : children) { }
ret.emplace_back(*child);
} }
return ret; return ret;
} }