| 966 | } |
| 967 | |
| 968 | std::vector<CTxMemPool::txiter> CTxMemPool::GatherClusters(const std::vector<Txid>& txids) const |
| 969 | { |
| 970 | AssertLockHeld(cs); |
| 971 | |
| 972 | std::vector<CTxMemPool::txiter> ret; |
| 973 | std::set<const CTxMemPoolEntry*> unique_cluster_representatives; |
| 974 | for (auto txid : txids) { |
| 975 | auto it = mapTx.find(txid); |
| 976 | if (it != mapTx.end()) { |
| 977 | // Note that TxGraph::GetCluster will return results in graph |
| 978 | // order, which is deterministic (as long as we are not modifying |
| 979 | // the graph). |
| 980 | auto cluster = m_txgraph->GetCluster(*it, TxGraph::Level::MAIN); |
| 981 | if (unique_cluster_representatives.insert(static_cast<const CTxMemPoolEntry*>(&(**cluster.begin()))).second) { |
| 982 | for (auto tx : cluster) { |
| 983 | ret.emplace_back(mapTx.iterator_to(static_cast<const CTxMemPoolEntry&>(*tx))); |
| 984 | } |
| 985 | } |
| 986 | } |
| 987 | } |
| 988 | if (ret.size() > 500) { |
| 989 | return {}; |
| 990 | } |
| 991 | return ret; |
| 992 | } |
| 993 | |
| 994 | util::Result<std::pair<std::vector<FeeFrac>, std::vector<FeeFrac>>> CTxMemPool::ChangeSet::CalculateChunksForRBF() |
| 995 | { |