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

View File

@ -9,7 +9,7 @@
<br />
<strong>Support:</strong>&nbsp;<a href="mailto:{{ .VspStats.SupportEmail }}" rel="noopener noreferrer">{{ .VspStats.SupportEmail }}</a>
<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>
</div>