diff --git a/storagemarket/impl/clientutils/clientutils.go b/storagemarket/impl/clientutils/clientutils.go index a99b4228..8e859820 100644 --- a/storagemarket/impl/clientutils/clientutils.go +++ b/storagemarket/impl/clientutils/clientutils.go @@ -53,15 +53,8 @@ func CommP(ctx context.Context, bs bstore.Blockstore, data *storagemarket.DataRe // do a CARv1 traversal with the DFS selector. sc := car.NewSelectiveCar(ctx, bs, []car.Dag{{Root: data.Root, Selector: selectorparse.CommonSelector_ExploreAllRecursively}}, car.MaxTraversalLinks(maxTraversalLinks)) - prepared, err := sc.Prepare() - if err != nil { - return cid.Undef, 0, xerrors.Errorf("failed to prepare CAR: %w", err) - } - - // write out the deterministic CARv1 payload to the CommP writer and calculate the CommP. commpWriter := &writer.Writer{} - err = prepared.Dump(ctx, commpWriter) - if err != nil { + if err := sc.Write(commpWriter); err != nil { return cid.Undef, 0, xerrors.Errorf("failed to write CARv1 to commP writer: %w", err) } dataCIDSize, err := commpWriter.Sum()