-
Notifications
You must be signed in to change notification settings - Fork 17
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
Dont double count data sent #185
Conversation
209dc7d
to
3c0714a
Compare
3c0714a
to
6fd0e16
Compare
if chid.Initiator != m.peerID { | ||
var result datatransfer.VoucherResult | ||
var err error | ||
var handled bool | ||
_ = m.revalidators.Each(func(_ datatransfer.TypeIdentifier, _ encoding.Decoder, processor registry.Processor) error { | ||
revalidator := processor.(datatransfer.Revalidator) | ||
handled, result, err = revalidator.OnPushDataReceived(chid, size) | ||
if handled { | ||
return errors.New("stop processing") | ||
} | ||
return nil | ||
}) | ||
if err != nil || result != nil { | ||
msg, err := m.processRevalidationResult(chid, result, err) | ||
if msg != nil { | ||
if err := m.dataTransferNetwork.SendMessage(context.TODO(), chid.Initiator, msg); err != nil { | ||
return err | ||
} |
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.
Note: the logic hasn't changed here, just the indentation.
I suggest viewing with whitespace changes turned off:
https://github.com/filecoin-project/go-data-transfer/pull/185/files?diff=unified&w=1
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.
@dirkmc LGTM. Just some nits we need to fix in the test.
Fixes #184
Tasks: