mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-09-11 05:35:23 +03:00
refresh pool stats w/ each share found
This commit is contained in:
parent
bbe6810422
commit
37551b3721
@ -308,6 +308,16 @@ func GetMiningState() *GetMiningStateResponse {
|
||||
}
|
||||
}
|
||||
|
||||
func updatePoolStats(isMining bool) {
|
||||
s := stats.GetSnapshot(isMining)
|
||||
configMutex.Lock()
|
||||
uname := plArgs.Username
|
||||
configMutex.Unlock()
|
||||
if uname != s.PoolUsername || s.SecondsOld > 5 {
|
||||
stats.RefreshPoolStats(uname)
|
||||
}
|
||||
}
|
||||
|
||||
func printStats(isMining bool) {
|
||||
s := stats.GetSnapshot(isMining)
|
||||
crylog.Info("=====================================")
|
||||
@ -359,6 +369,7 @@ func goMine(wg *sync.WaitGroup, stopper *uint32, job client.MultiClientJob, thre
|
||||
break
|
||||
}
|
||||
stats.TallyHashes(res)
|
||||
updatePoolStats(true)
|
||||
crylog.Info("Share found by thread:", thread, "Target:", blockchain.HashDifficulty(hash))
|
||||
fnonce := hex.EncodeToString(nonce)
|
||||
// If the client is alive, submit the share in a separate thread so we can resume hashing
|
||||
|
Loading…
Reference in New Issue
Block a user