MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetDescendantRefs

Method GetDescendantRefs

src/txgraph.cpp:2347–2364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2345}
2346
2347void GenericClusterImpl::GetDescendantRefs(const TxGraphImpl& graph, std::span<std::pair<Cluster*, DepGraphIndex>>& args, std::vector<TxGraph::Ref*>& output) noexcept
2348{
2349 /** The union of all descendants to be returned. */
2350 SetType descendants_union;
2351 // Process elements from the front of args, as long as they apply.
2352 while (!args.empty()) {
2353 if (args.front().first != this) break;
2354 descendants_union |= m_depgraph.Descendants(args.front().second);
2355 args = args.subspan(1);
2356 }
2357 Assume(descendants_union.Any());
2358 // Translate all descendants (in arbitrary order) to Refs (if they have any), and return them.
2359 for (auto idx : descendants_union) {
2360 const auto& entry = graph.m_entries[m_mapping[idx]];
2361 Assume(entry.m_ref != nullptr);
2362 output.push_back(entry.m_ref);
2363 }
2364}
2365
2366void SingletonClusterImpl::GetDescendantRefs(const TxGraphImpl& graph, std::span<std::pair<Cluster*, DepGraphIndex>>& args, std::vector<TxGraph::Ref*>& output) noexcept
2367{

Callers 2

GetDescendantsMethod · 0.80
GetDescendantsUnionMethod · 0.80

Calls 4

emptyMethod · 0.45
frontMethod · 0.45
AnyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected