This commit is contained in:
Sammy Libre 2018-03-14 21:28:07 +05:00
parent f4964a23f8
commit 2ab620d673
2 changed files with 2 additions and 2 deletions

View File

@ -161,7 +161,7 @@ func (m *Miner) processShare(s *StratumServer, cs *Session, job *Job, t *BlockTe
return false
}
hashDiff, ok := util.GetHashDifficulty(hashBytes) // FIXME: Will return max int64 value if overflows
hashDiff, ok := util.GetHashDifficulty(hashBytes)
if !ok {
log.Printf("Bad hash from miner %v@%v", m.id, cs.ip)
atomic.AddInt64(&m.invalidShares, 1)

View File

@ -29,7 +29,7 @@ func TestGetHashDifficulty(t *testing.T) {
}
}
func TestGetHashDifficultyWothBrokenHash(t *testing.T) {
func TestGetHashDifficultyWithBrokenHash(t *testing.T) {
hash := ""
hashBytes, _ := hex.DecodeString(hash)
shareDiff, ok := GetHashDifficulty(hashBytes)