Eliminate use of cached ancestor data in miniminer_tests and truc_policy

This commit is contained in:
Suhas Daftuar
2024-04-14 13:49:03 -04:00
committed by Suhas Daftuar
parent ba09fc9774
commit b9a2039f51
7 changed files with 66 additions and 52 deletions

View File

@@ -286,6 +286,9 @@ public:
std::tuple<size_t, size_t, CAmount> CalculateAncestorData(const CTxMemPoolEntry& entry) const EXCLUSIVE_LOCKS_REQUIRED(cs);
std::tuple<size_t, size_t, CAmount> CalculateDescendantData(const CTxMemPoolEntry& entry) const EXCLUSIVE_LOCKS_REQUIRED(cs);
int64_t GetDescendantCount(txiter it) const { LOCK(cs); return m_txgraph->GetDescendants(*it, TxGraph::Level::MAIN).size(); }
int64_t GetDescendantCount(const CTxMemPoolEntry &e) const { LOCK(cs); return m_txgraph->GetDescendants(e, TxGraph::Level::MAIN).size(); }
int64_t GetAncestorCount(const CTxMemPoolEntry &e) const { LOCK(cs); return m_txgraph->GetAncestors(e, TxGraph::Level::MAIN).size(); }
private:
typedef std::map<txiter, setEntries, CompareIteratorByHash> cacheMap;