-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
worker: don't record host scan on 'successfull failure'
- Loading branch information
1 parent
f90040a
commit 660ea3d
Showing
3 changed files
with
31 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
package worker | ||
|
||
func isSuccessfulInteraction(err error) bool { | ||
// No error always means success. | ||
if err == nil { | ||
return true | ||
} | ||
// List of errors that are considered successful interactions. | ||
func shouldRecordPriceTable(err error) bool { | ||
// List of errors that are considered 'successful' failures. Meaning that | ||
// the host was reachable but we were unable to obtain a price table due to | ||
// reasons out of the host's control. | ||
if isInsufficientFunds(err) { | ||
return true | ||
return false | ||
} | ||
if isBalanceInsufficient(err) { | ||
return true | ||
return false | ||
} | ||
return false | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters