From 5ca410ae99c03de53bf80c3c9d298929a9ff62bd Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Thu, 13 Aug 2020 22:21:20 -0400 Subject: [PATCH] extract overestimation factor into a constant --- markets/storageadapter/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/markets/storageadapter/client.go b/markets/storageadapter/client.go index 31a63fb65..f621c3838 100644 --- a/markets/storageadapter/client.go +++ b/markets/storageadapter/client.go @@ -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 {