Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use collateral from ProposeStorageDealParams #371

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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