Browse Source

Add prev block hash to stats

pool
Sammy Libre 8 years ago
parent
commit
51c9f28c4b
  1. 1
      go-pool/stratum/api.go
  2. 3
      www/index.html

1
go-pool/stratum/api.go

@ -42,6 +42,7 @@ func (s *StratumServer) StatsIndex(w http.ResponseWriter, r *http.Request) { @@ -42,6 +42,7 @@ func (s *StratumServer) StatsIndex(w http.ResponseWriter, r *http.Request) {
stats["diff"] = t.Difficulty
roundShares := atomic.LoadInt64(&s.roundShares)
stats["variance"] = float64(roundShares) / float64(t.Difficulty)
stats["prevHash"] = t.PrevHash[0:8]
stats["template"] = true
}
json.NewEncoder(w).Encode(stats)

3
www/index.html

@ -48,8 +48,9 @@ @@ -48,8 +48,9 @@
<div class="col-xs-12">
{{#if template}}
<p>
<strong>Block height:</strong> <span class="label label-primary">{{height}}</span>
<strong>Block Height:</strong> <span class="label label-primary">{{height}}</span>
<strong>Difficulty:</strong> <span class="label label-primary">{{formatNumber diff maximumFractionDigits=4}}</span>
<strong>PrevHash:</strong> <span class="label label-primary">{{prevHash}}</span>
</p>
{{/if}}
</div>

Loading…
Cancel
Save