diff --git a/storage/redis.go b/storage/redis.go index 2cf6e40..0617e9a 100644 --- a/storage/redis.go +++ b/storage/redis.go @@ -107,6 +107,7 @@ func (b *BlockData) key() string { type Miner struct { LastBeat int64 `json:"lastBeat"` HR int64 `json:"hr"` + Shares int `json:"shares"` Offline bool `json:"offline"` startedAt int64 } @@ -117,6 +118,7 @@ type Worker struct { TotalHR int64 `json:"hr2"` WorkerDiff int64 `json:"difficulty"` WorkerHostname string `json:"hostname"` + TotalShares int `json:"valid"` } func NewRedisClient(cfg *Config, prefix string, pplns int64) *RedisClient { @@ -1211,6 +1213,7 @@ func convertWorkersStats(window int64, raw *redis.ZSliceCmd) map[string]Worker { // Add for large window worker.TotalHR += share + worker.TotalShares += 1 // Addition from Mohannad Otaibi to report Difficulty worker.WorkerDiff = share @@ -1220,6 +1223,7 @@ func convertWorkersStats(window int64, raw *redis.ZSliceCmd) map[string]Worker { // Add for small window if matches if score >= now-window { worker.HR += share + worker.Shares += 1 } if worker.LastBeat < score { diff --git a/www/app/templates/account/index.hbs b/www/app/templates/account/index.hbs index 5d982a9..c15b85d 100644 --- a/www/app/templates/account/index.hbs +++ b/www/app/templates/account/index.hbs @@ -11,6 +11,7 @@ {{t "account.earnings.worker"}} {{t "account.difficulty"}} {{t "account.server"}} + {{t "account.valid"}} {{t "account.last_share"}} @@ -22,6 +23,7 @@ {{format-number (worker-earnperday v.hr netstats.hashrate)}} {{config.Unit}} {{format-difficulty v.difficulty}} {{v.hostname}} + {{v.valid}} {{format-relative (seconds-to-ms v.lastBeat)}} {{/each-in}} diff --git a/www/translations/en-us.yaml b/www/translations/en-us.yaml index f03ce3f..709a349 100644 --- a/www/translations/en-us.yaml +++ b/www/translations/en-us.yaml @@ -76,6 +76,7 @@ account: your_workers: Workers server: Server + valid: valid difficulty: Difficulty last_share: Last Seen short_average: rough, short average