mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-09-11 05:35:23 +03:00
Merge branch 'master' of https://github.com/cryptonote-social/csminer
This commit is contained in:
commit
c61c6f1d1a
@ -100,8 +100,8 @@ func ResetRecent() {
|
|||||||
type Snapshot struct {
|
type Snapshot struct {
|
||||||
SharesAccepted, SharesRejected int64
|
SharesAccepted, SharesRejected int64
|
||||||
ClientSideHashes, PoolSideHashes int64
|
ClientSideHashes, PoolSideHashes int64
|
||||||
// A negative value for hashrate is used to indicate "still calculating" (e.g. not enough of a
|
// A negative value for RecentHashrate is used to indicate "still calculating" (e.g. not enough
|
||||||
// time window to be accurate)
|
// of a time window to be accurate)
|
||||||
Hashrate, RecentHashrate float64
|
Hashrate, RecentHashrate float64
|
||||||
|
|
||||||
// Pool stats
|
// Pool stats
|
||||||
@ -137,7 +137,7 @@ func GetSnapshot(isMining bool) (s *Snapshot, secondsSinceReset float64, seconds
|
|||||||
if isMining {
|
if isMining {
|
||||||
// Recent stats are only accurate up to the last snapshot time
|
// Recent stats are only accurate up to the last snapshot time
|
||||||
elapsedRecent = accurateTime.Sub(recentStatsResetTime).Seconds()
|
elapsedRecent = accurateTime.Sub(recentStatsResetTime).Seconds()
|
||||||
if elapsedRecent > 5.0 {
|
if elapsedRecent > 5.0 && recentHashesAccurate > 0 {
|
||||||
// For accurate results, we require at least 5 seconds of mining during the recent
|
// For accurate results, we require at least 5 seconds of mining during the recent
|
||||||
// period in order to return a recent hashrate.
|
// period in order to return a recent hashrate.
|
||||||
r.RecentHashrate = float64(recentHashesAccurate) / elapsedRecent
|
r.RecentHashrate = float64(recentHashesAccurate) / elapsedRecent
|
||||||
|
Loading…
Reference in New Issue
Block a user