Fix a calculation error in price-per-byte in retrievals

This commit is contained in:
Geoff Stuart 2022-09-21 15:29:34 -04:00
parent c7d4c9d26d
commit a1e08e5664

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") 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) params, err := rm.NewParamsV1(ppb, order.PaymentInterval, order.PaymentIntervalIncrease, sel, order.Piece, order.UnsealPrice)
if err != nil { if err != nil {