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

Method GetReducedParents

src/cluster_linearize.h:211–222  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

209 * Complexity: O(N) where N=Ancestors(i).Count() (which is bounded by TxCount()).
210 */
211 SetType GetReducedParents(DepGraphIndex i) const noexcept
212 {
213 SetType parents = Ancestors(i);
214 parents.Reset(i);
215 for (auto parent : parents) {
216 if (parents[parent]) {
217 parents -= Ancestors(parent);
218 parents.Set(parent);
219 }
220 }
221 return parents;
222 }
223
224 /** Compute the (reduced) set of children of node i in this graph.
225 *

Callers 8

DepGraphMethod · 0.80
SpanningForestStateMethod · 0.80
SanityCheckMethod · 0.80
ExtractTransactionsMethod · 0.80
SplitMethod · 0.80
FUZZ_TARGETFunction · 0.80
BuildTreeGraphFunction · 0.80
SanityCheckFunction · 0.80

Calls 2

ResetMethod · 0.45
SetMethod · 0.45

Tested by 3

FUZZ_TARGETFunction · 0.64
BuildTreeGraphFunction · 0.64
SanityCheckFunction · 0.64