Merge pull request #9353 from filecoin-project/gstuart/retrieval-calculation-fix

fix: retrievals: price-per-byte calculation fix
This commit is contained in:
Aayush Rajasekaran
2022-09-21 15:50:47 -04:00
committed by GitHub
+1 -1
View File
@@ -837,7 +837,7 @@ func (a *API) doRetrieval(ctx context.Context, order api.RetrievalOrder, sel dat
return 0, xerrors.Errorf("cannot make retrieval deal for zero bytes")
}
ppb := types.BigDiv(order.Total, types.NewInt(order.Size))
ppb := types.BigDiv(big.Sub(order.Total, order.UnsealPrice), types.NewInt(order.Size))
params, err := rm.NewParamsV1(ppb, order.PaymentInterval, order.PaymentIntervalIncrease, sel, order.Piece, order.UnsealPrice)
if err != nil {