From ba09fc9774d5a0eaa58d93a2fa20bef1efc74f1e Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Wed, 4 Oct 2023 09:19:21 -0400 Subject: [PATCH] mempool: Remove unused function CalculateDescendantMaximum --- src/txmempool.cpp | 22 ---------------------- src/txmempool.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index e268fd61e79..7c3be6e1d85 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1165,28 +1165,6 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector* pvNoSpends } } -uint64_t CTxMemPool::CalculateDescendantMaximum(txiter entry) const { - // find parent with highest descendant count - std::vector candidates; - setEntries counted; - candidates.push_back(entry); - uint64_t maximum = 0; - while (candidates.size()) { - txiter candidate = candidates.back(); - candidates.pop_back(); - if (!counted.insert(candidate).second) continue; - const CTxMemPoolEntry::Parents& parents = candidate->GetMemPoolParentsConst(); - if (parents.size() == 0) { - maximum = std::max(maximum, candidate->GetCountWithDescendants()); - } else { - for (const CTxMemPoolEntry& i : parents) { - candidates.push_back(mapTx.iterator_to(i)); - } - } - } - return maximum; -} - std::tuple CTxMemPool::CalculateAncestorData(const CTxMemPoolEntry& entry) const { auto ancestors = m_txgraph->GetAncestors(entry, TxGraph::Level::MAIN); diff --git a/src/txmempool.h b/src/txmempool.h index 520410b6849..054d9e12891 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -284,8 +284,6 @@ public: using Limits = kernel::MemPoolLimits; - uint64_t CalculateDescendantMaximum(txiter entry) const EXCLUSIVE_LOCKS_REQUIRED(cs); - std::tuple CalculateAncestorData(const CTxMemPoolEntry& entry) const EXCLUSIVE_LOCKS_REQUIRED(cs); std::tuple CalculateDescendantData(const CTxMemPoolEntry& entry) const EXCLUSIVE_LOCKS_REQUIRED(cs);