deals: Use correct file size for commP
This commit is contained in:
parent
9127bc2841
commit
feee3893bf
@ -121,6 +121,11 @@ func (c *Client) Start(ctx context.Context, data cid.Cid, totalPrice types.BigIn
|
|||||||
return cid.Undef, xerrors.New("unsupported unixfs type")
|
return cid.Undef, xerrors.New("unsupported unixfs type")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size, err := uf.Size()
|
||||||
|
if err != nil {
|
||||||
|
return cid.Cid{}, err
|
||||||
|
}
|
||||||
|
|
||||||
f, err := ioutil.TempFile(os.TempDir(), "commP-temp-")
|
f, err := ioutil.TempFile(os.TempDir(), "commP-temp-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cid.Undef, err
|
return cid.Undef, err
|
||||||
@ -131,7 +136,7 @@ func (c *Client) Start(ctx context.Context, data cid.Cid, totalPrice types.BigIn
|
|||||||
if err := f.Close(); err != nil {
|
if err := f.Close(); err != nil {
|
||||||
return cid.Undef, err
|
return cid.Undef, err
|
||||||
}
|
}
|
||||||
commP, err := sectorbuilder.GeneratePieceCommitment(f.Name(), 6)
|
commP, err := sectorbuilder.GeneratePieceCommitment(f.Name(), uint64(size))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cid.Undef, err
|
return cid.Undef, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user