From 96b99f35d707e66f405f211ef645738773b0cb22 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Thu, 31 Aug 2023 09:28:43 +0100 Subject: [PATCH] webapi: Add expired/missed to /vspinfo. --- docs/api.md | 2 ++ go.mod | 2 +- go.sum | 4 ++-- webapi/vspinfo.go | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/api.md b/docs/api.md index 0d6416a..68b4478 100644 --- a/docs/api.md +++ b/docs/api.md @@ -57,6 +57,8 @@ when a VSP is closed will result in an error. "totalvotingwallets":3, "votingwalletsonline":3, "revoked":3, + "expired":2, + "missed":1, "blockheight":623212, "estimatednetworkproportion":0.048478414 } diff --git a/go.mod b/go.mod index a448dbb..6128ad9 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/decred/dcrd/wire v1.6.0 github.com/decred/slog v1.2.0 github.com/decred/vspd/client/v2 v2.0.0 - github.com/decred/vspd/types/v2 v2.0.0 + github.com/decred/vspd/types/v2 v2.1.0 github.com/dustin/go-humanize v1.0.1 github.com/gin-gonic/gin v1.9.1 github.com/gorilla/sessions v1.2.1 diff --git a/go.sum b/go.sum index e37278f..78f1afb 100644 --- a/go.sum +++ b/go.sum @@ -54,8 +54,8 @@ github.com/decred/slog v1.2.0 h1:soHAxV52B54Di3WtKLfPum9OFfWqwtf/ygf9njdfnPM= github.com/decred/slog v1.2.0/go.mod h1:kVXlGnt6DHy2fV5OjSeuvCJ0OmlmTF6LFpEPMu/fOY0= github.com/decred/vspd/client/v2 v2.0.0 h1:gaSF1Bm2/EvoAiSLxNR5fgStrObAO66xmanhedidYIM= github.com/decred/vspd/client/v2 v2.0.0/go.mod h1:IDDviEe/6CuxxrW0PLOcg448enU3YmeElFHledYHw78= -github.com/decred/vspd/types/v2 v2.0.0 h1:FaPA+W4OOMRWK+Vk4fyyYdXoVLRMMRQsxzsnSjJjOnI= -github.com/decred/vspd/types/v2 v2.0.0/go.mod h1:2xnNqedkt9GuL+pK8uIzDxqYxFlwLRflYFJH64b76n0= +github.com/decred/vspd/types/v2 v2.1.0 h1:cUVlmHPeLVsksPRnr2WHsmC2t1Skl6g1WH0HmpcPS7w= +github.com/decred/vspd/types/v2 v2.1.0/go.mod h1:2xnNqedkt9GuL+pK8uIzDxqYxFlwLRflYFJH64b76n0= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= diff --git a/webapi/vspinfo.go b/webapi/vspinfo.go index 2cb26c5..6c53cf6 100644 --- a/webapi/vspinfo.go +++ b/webapi/vspinfo.go @@ -29,6 +29,8 @@ func (s *Server) vspInfo(c *gin.Context) { TotalVotingWallets: cachedStats.TotalVotingWallets, VotingWalletsOnline: cachedStats.VotingWalletsOnline, Revoked: cachedStats.Expired + cachedStats.Missed, + Expired: cachedStats.Expired, + Missed: cachedStats.Missed, BlockHeight: cachedStats.BlockHeight, NetworkProportion: cachedStats.NetworkProportion, }, c)