func provideKeysRec(ctx context.Context, r routing.IpfsRouting, dserv dag.DAGService, cids []*cid.Cid) error { provided := cid.NewSet() for _, c := range cids { kset := cid.NewSet() err := dag.EnumerateChildrenAsync(ctx, dserv, c, kset.Visit) if err != nil { return err } for _, k := range kset.Keys() { if provided.Has(k) { continue } err = r.Provide(ctx, k) if err != nil { return err } provided.Add(k) } } return nil }
func provideKeys(ctx context.Context, r routing.IpfsRouting, cids []*cid.Cid) error { for _, c := range cids { err := r.Provide(ctx, c) if err != nil { return err } } return nil }