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

Method GetReducedChildren

src/cluster_linearize.h:232–243  ·  view source on GitHub ↗

Compute the (reduced) set of children of node i in this graph. * * This returns the minimal subset of the children of i whose descendants together equal all of * i's descendants (unless i is part of a cycle of dependencies). Note that DepGraph does not * store the set of children; this information is inferred from the descendant sets. * * Complexity: O(N) where N=Desc

Source from the content-addressed store, hash-verified

230 * Complexity: O(N) where N=Descendants(i).Count() (which is bounded by TxCount()).
231 */
232 SetType GetReducedChildren(DepGraphIndex i) const noexcept
233 {
234 SetType children = Descendants(i);
235 children.Reset(i);
236 for (auto child : children) {
237 if (children[child]) {
238 children -= Descendants(child);
239 children.Set(child);
240 }
241 }
242 return children;
243 }
244
245 /** Compute the aggregate feerate of a set of nodes in this graph.
246 *

Callers 3

SanityCheckMethod · 0.80
BuildTreeGraphFunction · 0.80
SanityCheckFunction · 0.80

Calls 2

ResetMethod · 0.45
SetMethod · 0.45

Tested by 2

BuildTreeGraphFunction · 0.64
SanityCheckFunction · 0.64