Skip to content

Commit

Permalink
Use collateral from ProposeStorageDealParams
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Aug 14, 2020
1 parent 6151b82 commit 158b3e7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions storagemarket/impl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,12 @@ func (c *Client) ProposeStorageDeal(ctx context.Context, params storagemarket.Pr
return nil, fmt.Errorf("cannot propose a deal whose piece size (%d) is greater than sector size (%d)", pieceSize.Padded(), params.Info.SectorSize)
}

pcMin, _, err := c.node.DealProviderCollateralBounds(ctx, pieceSize.Padded(), params.VerifiedDeal)
if err != nil {
return nil, xerrors.Errorf("computing deal provider collateral bound failed: %w", err)
pcMin := params.Collateral
if pcMin.Int == nil || pcMin.IsZero() {
pcMin, _, err = c.node.DealProviderCollateralBounds(ctx, pieceSize.Padded(), params.VerifiedDeal)
if err != nil {
return nil, xerrors.Errorf("computing deal provider collateral bound failed: %w", err)
}
}

label, err := clientutils.LabelField(params.Data.Root)
Expand Down

0 comments on commit 158b3e7

Please sign in to comment.