diff --git a/gc/gc.go b/gc/gc.go index bf8b7b10fa10156fcc114fe2d5f210299c5032ff..7190b1e015866e3d4400b02a52660268ccf5a488 100644 --- a/gc/gc.go +++ b/gc/gc.go @@ -170,10 +170,8 @@ func Descendants(ctx context.Context, getLinks dag.GetLinks, set *cid.Set, roots } for _, c := range roots { - set.Add(c) - - // EnumerateChildren recursively walks the dag and adds the keys to the given set - err := dag.EnumerateChildren(ctx, verifyGetLinks, c, set.Visit) + // Walk recursively walks the dag and adds the keys to the given set + err := dag.Walk(ctx, verifyGetLinks, c, set.Visit) if err != nil { err = verboseCidError(err)