mirror of
https://github.com/kvazar-network/keva-stratum.git
synced 2025-02-09 21:46:25 +00:00
Fix share logging
This commit is contained in:
parent
0fa56841d3
commit
0a51384b1d
@ -162,10 +162,6 @@ func (m *Miner) processShare(s *StratumServer, cs *Session, job *Job, t *BlockTe
|
|||||||
}
|
}
|
||||||
|
|
||||||
hashDiff := util.GetHashDifficulty(hashBytes).Int64() // FIXME: Will return max int64 value if overflows
|
hashDiff := util.GetHashDifficulty(hashBytes).Int64() // FIXME: Will return max int64 value if overflows
|
||||||
atomic.AddInt64(&s.roundShares, cs.endpoint.config.Difficulty)
|
|
||||||
atomic.AddUint64(&m.validShares, 1)
|
|
||||||
m.storeShare(cs.endpoint.config.Difficulty)
|
|
||||||
|
|
||||||
block := hashDiff >= t.difficulty
|
block := hashDiff >= t.difficulty
|
||||||
|
|
||||||
if block {
|
if block {
|
||||||
@ -198,6 +194,10 @@ func (m *Miner) processShare(s *StratumServer, cs *Session, job *Job, t *BlockTe
|
|||||||
atomic.AddUint64(&m.invalidShares, 1)
|
atomic.AddUint64(&m.invalidShares, 1)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atomic.AddInt64(&s.roundShares, cs.endpoint.config.Difficulty)
|
||||||
|
atomic.AddUint64(&m.validShares, 1)
|
||||||
|
m.storeShare(cs.endpoint.config.Difficulty)
|
||||||
log.Printf("Valid share at difficulty %v/%v", cs.endpoint.config.Difficulty, hashDiff)
|
log.Printf("Valid share at difficulty %v/%v", cs.endpoint.config.Difficulty, hashDiff)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user