Skip to content

Commit

Permalink
webapi: Add expired/missed to /vspinfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jholdstock committed Sep 4, 2023
1 parent 54e2435 commit 96b99f3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/api.md
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions webapi/vspinfo.go
Expand Up @@ -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)
Expand Down

0 comments on commit 96b99f3

Please sign in to comment.