refactor(proxy): centralise invalid share classification
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
2d39783dc4
commit
4e5311215d
1 changed files with 2 additions and 2 deletions
|
|
@ -1307,7 +1307,7 @@ func (s *Stats) OnReject(e Event) {
|
|||
return
|
||||
}
|
||||
s.rejected.Add(1)
|
||||
if strings.Contains(strings.ToLower(e.Error), "difficulty") || strings.Contains(strings.ToLower(e.Error), "invalid") || strings.Contains(strings.ToLower(e.Error), "nonce") {
|
||||
if isInvalidShareReason(e.Error) {
|
||||
s.invalid.Add(1)
|
||||
}
|
||||
}
|
||||
|
|
@ -1520,7 +1520,7 @@ func (w *Workers) OnReject(e Event) {
|
|||
}
|
||||
record := &w.entries[index]
|
||||
record.Rejected++
|
||||
if strings.Contains(strings.ToLower(e.Error), "difficulty") || strings.Contains(strings.ToLower(e.Error), "invalid") || strings.Contains(strings.ToLower(e.Error), "nonce") {
|
||||
if isInvalidShareReason(e.Error) {
|
||||
record.Invalid++
|
||||
}
|
||||
record.LastIP = e.Miner.ip
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue