-
Notifications
You must be signed in to change notification settings - Fork 59
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
Disallow concurrent retrieval deals for same peer/cid #493
Conversation
Codecov Report
@@ Coverage Diff @@
## master #493 +/- ##
==========================================
+ Coverage 65.16% 65.41% +0.25%
==========================================
Files 50 51 +1
Lines 3266 3431 +165
==========================================
+ Hits 2128 2244 +116
- Misses 912 958 +46
- Partials 226 229 +3
Continue to review full report at Codecov.
|
c4c8c15
to
f9e8df5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
f9e8df5
to
5f11ad2
Compare
5f11ad2
to
ea7b41d
Compare
@@ -281,6 +296,31 @@ func (c *Client) Retrieve(ctx context.Context, payloadCID cid.Cid, params retrie | |||
return dealID, nil | |||
} | |||
|
|||
// Check if there's already an active retrieval deal with the same peer | |||
// for the same payload CID | |||
func (c *Client) checkForActiveDeal(payloadCID cid.Cid, pid peer.ID) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It would be more idiomatic to return (dealID, bool)
here, and create the error in the caller.
Addresses filecoin-project/lotus#5443