base64 encoding for pubkey on homepage

This commit is contained in:
jholdstock 2020-07-14 09:41:56 +01:00 committed by David Hill
parent a112127247
commit 5018d45908
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package webapi package webapi
import ( import (
"encoding/base64"
"net/http" "net/http"
"sync" "sync"
"time" "time"
@ -11,7 +12,7 @@ import (
) )
type vspStats struct { type vspStats struct {
PubKey []byte PubKey string
TotalTickets int TotalTickets int
FeeConfirmedTickets int FeeConfirmedTickets int
VSPFee float64 VSPFee float64
@ -43,7 +44,7 @@ func updateVSPStats(db *database.VspDatabase, cfg Config) error {
defer statsMtx.Unlock() defer statsMtx.Unlock()
stats = &vspStats{ stats = &vspStats{
PubKey: signPubKey, PubKey: base64.StdEncoding.EncodeToString(signPubKey),
TotalTickets: total, TotalTickets: total,
FeeConfirmedTickets: feeConfirmed, FeeConfirmedTickets: feeConfirmed,
VSPFee: cfg.VSPFee, VSPFee: cfg.VSPFee,

View File

@ -9,7 +9,7 @@
<br /> <br />
<strong>Support:</strong>&nbsp;<a href="mailto:{{ .VspStats.SupportEmail }}" rel="noopener noreferrer">{{ .VspStats.SupportEmail }}</a> <strong>Support:</strong>&nbsp;<a href="mailto:{{ .VspStats.SupportEmail }}" rel="noopener noreferrer">{{ .VspStats.SupportEmail }}</a>
<br /> <br />
<strong>VSP&nbsp;public&nbsp;key:</strong>&nbsp;<span class="code">{{ printf "%x" .VspStats.PubKey }}</span> <strong>VSP&nbsp;public&nbsp;key:</strong>&nbsp;<span class="code">{{ .VspStats.PubKey }}</span>
</p> </p>
</div> </div>