extract overestimation factor into a constant

This commit is contained in:
Aayush Rajasekaran 2020-08-13 22:21:20 -04:00
parent 2d90bcff3c
commit 5ca410ae99

View File

@ -225,13 +225,15 @@ func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal stor
return res.IDs[dealIdx], nil
}
const clientOverestimation = 2
func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error) {
bounds, err := c.StateDealProviderCollateralBounds(ctx, size, isVerified, types.EmptyTSK)
if err != nil {
return abi.TokenAmount{}, abi.TokenAmount{}, err
}
return big.Mul(bounds.Min, big.NewInt(2)), bounds.Max, nil
return big.Mul(bounds.Min, big.NewInt(clientOverestimation)), bounds.Max, nil
}
func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealId abi.DealID, cb storagemarket.DealSectorCommittedCallback) error {