Browse Source

Fix typo

pool
Sammy Libre 7 years ago
parent
commit
2ab620d673
  1. 2
      stratum/miner.go
  2. 2
      util/util_test.go

2
stratum/miner.go

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

2
util/util_test.go

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

Loading…
Cancel
Save