Commit c43f539f authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

cmds/cat: fix length to use reader.Size()

unixfs file size != merkledag cumulative size
parent fcd8ebcc
......@@ -68,17 +68,12 @@ func cat(node *core.IpfsNode, paths []string) ([]io.Reader, uint64, error) {
return nil, 0, err
}
nodeLength, err := dagnode.Size()
if err != nil {
return nil, 0, err
}
length += nodeLength
read, err := uio.NewDagReader(node.Context(), dagnode, node.DAG)
if err != nil {
return nil, 0, err
}
readers = append(readers, read)
length += uint64(read.Size())
}
return readers, length, nil
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment