From 51c9f28c4bfbc9520df43b2b810b0d52691deac9 Mon Sep 17 00:00:00 2001 From: Sammy Libre Date: Tue, 6 Dec 2016 23:29:43 +0500 Subject: [PATCH] Add prev block hash to stats --- go-pool/stratum/api.go | 1 + www/index.html | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go-pool/stratum/api.go b/go-pool/stratum/api.go index 5eef9c8..b99d98c 100644 --- a/go-pool/stratum/api.go +++ b/go-pool/stratum/api.go @@ -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) diff --git a/www/index.html b/www/index.html index a9827ae..04c4cf2 100644 --- a/www/index.html +++ b/www/index.html @@ -48,8 +48,9 @@
{{#if template}}

- Block height: {{height}} + Block Height: {{height}} Difficulty: {{formatNumber diff maximumFractionDigits=4}} + PrevHash: {{prevHash}}

{{/if}}