Add prev block hash to stats

This commit is contained in:
Sammy Libre 2016-12-06 23:29:43 +05:00
parent 7f609a8b59
commit 51c9f28c4b
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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>