-
Notifications
You must be signed in to change notification settings - Fork 75
fix: bug bypassing basic filters #1217
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
Conversation
if p.config.StorageFilter == "" { | ||
return nil | ||
} |
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.
Can you explain the change here?
I don't understand why we would make the call to get deal filter params if the StorageFilter is not set?
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.
So, it would seem we still need to call the BasicDealFilter() even when external deal filter is not set. The removed part of the code skipped that section and basic deal filter was not running. Once BasicDealFilter() completes the checks like we have enough storage, funds etc on SP side, then it runs "cmd" filter.
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.
Ok that makes sense, thanks 👍
In that case I would change the code in getDealFilterParams
so that if the storage filter is not set, it doesn't get the funds or storage status either.
In other words at the top of getDealFilterParams
:
if p.config.StorageFilter == "" {
return &dealfilter.DealFilterParams{
FundsState: <zero value for funds status>,
StorageState: <zero value for storage state> ,
}
}
Please also add a comment to the code explaining what you said in your github comment above.
Nice work 🙌 |
* fix bug bypassing basic filters * update code comments
* fix bug bypassing basic filters * update code comments
Basic filters are now working as expected.
Online = false and offline = true
online = true and offline = false
