| 1280 | } |
| 1281 | |
| 1282 | uint64_t CTxMemPool::CalculateDescendantMaximum(txiter entry) const { |
| 1283 | // find parent with highest descendant count |
| 1284 | std::vector<txiter> candidates; |
| 1285 | setEntries counted; |
| 1286 | candidates.push_back(entry); |
| 1287 | uint64_t maximum = 0; |
| 1288 | while (candidates.size()) { |
| 1289 | txiter candidate = candidates.back(); |
| 1290 | candidates.pop_back(); |
| 1291 | if (!counted.insert(candidate).second) continue; |
| 1292 | const CTxMemPoolEntry::Parents& parents = candidate->GetMemPoolParentsConst(); |
| 1293 | if (parents.size() == 0) { |
| 1294 | maximum = std::max(maximum, candidate->GetCountWithDescendants()); |
| 1295 | } else { |
| 1296 | for (const CTxMemPoolEntry& i : parents) { |
| 1297 | candidates.push_back(mapTx.iterator_to(i)); |
| 1298 | } |
| 1299 | } |
| 1300 | } |
| 1301 | return maximum; |
| 1302 | } |
| 1303 | |
| 1304 | void CTxMemPool::GetTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants, size_t* const ancestorsize, CAmount* const ancestorfees) const { |
| 1305 | LOCK(cs); |
nothing calls this directly
no test coverage detected