Browse Source

valid Shares

master
yuriy0803 5 years ago
parent
commit
0b3bb2e937
  1. 4
      storage/redis.go
  2. 2
      www/app/templates/account/index.hbs
  3. 1
      www/translations/en-us.yaml

4
storage/redis.go

@ -107,6 +107,7 @@ func (b *BlockData) key() string {
type Miner struct { type Miner struct {
LastBeat int64 `json:"lastBeat"` LastBeat int64 `json:"lastBeat"`
HR int64 `json:"hr"` HR int64 `json:"hr"`
Shares int `json:"shares"`
Offline bool `json:"offline"` Offline bool `json:"offline"`
startedAt int64 startedAt int64
} }
@ -117,6 +118,7 @@ type Worker struct {
TotalHR int64 `json:"hr2"` TotalHR int64 `json:"hr2"`
WorkerDiff int64 `json:"difficulty"` WorkerDiff int64 `json:"difficulty"`
WorkerHostname string `json:"hostname"` WorkerHostname string `json:"hostname"`
TotalShares int `json:"valid"`
} }
func NewRedisClient(cfg *Config, prefix string, pplns int64) *RedisClient { 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 // Add for large window
worker.TotalHR += share worker.TotalHR += share
worker.TotalShares += 1
// Addition from Mohannad Otaibi to report Difficulty // Addition from Mohannad Otaibi to report Difficulty
worker.WorkerDiff = share worker.WorkerDiff = share
@ -1220,6 +1223,7 @@ func convertWorkersStats(window int64, raw *redis.ZSliceCmd) map[string]Worker {
// Add for small window if matches // Add for small window if matches
if score >= now-window { if score >= now-window {
worker.HR += share worker.HR += share
worker.Shares += 1
} }
if worker.LastBeat < score { if worker.LastBeat < score {

2
www/app/templates/account/index.hbs

@ -11,6 +11,7 @@
<th>{{t "account.earnings.worker"}}</th> <th>{{t "account.earnings.worker"}}</th>
<th>{{t "account.difficulty"}}</th> <th>{{t "account.difficulty"}}</th>
<th>{{t "account.server"}}</th> <th>{{t "account.server"}}</th>
<th>{{t "account.valid"}}</th>
<th>{{t "account.last_share"}}</th> <th>{{t "account.last_share"}}</th>
</tr> </tr>
</thead> </thead>
@ -22,6 +23,7 @@
<td>{{format-number (worker-earnperday v.hr netstats.hashrate)}} {{config.Unit}}</td> <td>{{format-number (worker-earnperday v.hr netstats.hashrate)}} {{config.Unit}}</td>
<td>{{format-difficulty v.difficulty}}</td> <td>{{format-difficulty v.difficulty}}</td>
<td>{{v.hostname}}</td> <td>{{v.hostname}}</td>
<td>{{v.valid}}</td>
<td>{{format-relative (seconds-to-ms v.lastBeat)}}</td> <td>{{format-relative (seconds-to-ms v.lastBeat)}}</td>
</tr> </tr>
{{/each-in}} {{/each-in}}

1
www/translations/en-us.yaml

@ -76,6 +76,7 @@ account:
your_workers: Workers your_workers: Workers
server: Server server: Server
valid: valid
difficulty: Difficulty difficulty: Difficulty
last_share: Last Seen last_share: Last Seen
short_average: rough, short average short_average: rough, short average

Loading…
Cancel
Save