From 5018d459084dce4676c72e62b409c2b1f43fc222 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Tue, 14 Jul 2020 09:41:56 +0100 Subject: [PATCH] base64 encoding for pubkey on homepage --- webapi/homepage.go | 5 +++-- webapi/templates/footer.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapi/homepage.go b/webapi/homepage.go index 926e851..fd9a7da 100644 --- a/webapi/homepage.go +++ b/webapi/homepage.go @@ -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, diff --git a/webapi/templates/footer.html b/webapi/templates/footer.html index 9da3ebc..8f56149 100644 --- a/webapi/templates/footer.html +++ b/webapi/templates/footer.html @@ -9,7 +9,7 @@
Support: {{ .VspStats.SupportEmail }}
- VSP public key: {{ printf "%x" .VspStats.PubKey }} + VSP public key: {{ .VspStats.PubKey }}