1
- // Copyright (c) 2017-2024 The Decred developers
1
+ // Copyright (c) 2017-2025 The Decred developers
2
2
// Use of this source code is governed by an ISC
3
3
// license that can be found in the LICENSE file.
4
4
@@ -33,7 +33,6 @@ type Vsp struct {
33
33
Closed bool `json:"closed"`
34
34
Voting int64 `json:"voting"`
35
35
Voted int64 `json:"voted"`
36
- Revoked int64 `json:"revoked"`
37
36
Expired int64 `json:"expired"`
38
37
Missed int64 `json:"missed"`
39
38
VspdVersion string `json:"vspdversion"`
@@ -230,16 +229,15 @@ func vspStats(service *Service, url string) error {
230
229
vspclosed , hasClosed := info ["vspclosed" ]
231
230
voting , hasVoting := info ["voting" ]
232
231
voted , hasVoted := info ["voted" ]
233
- revoked , hasRevoked := info ["revoked" ]
234
232
expired , hasExpired := info ["expired" ]
235
233
missed , hasMissed := info ["missed" ]
236
234
version , hasVersion := info ["vspdversion" ]
237
235
blockheight , hasBlockHeight := info ["blockheight" ]
238
236
networkproportion , hasnetworkproportion := info ["estimatednetworkproportion" ]
239
237
240
238
hasRequiredFields := hasAPIVersions && hasFeePercentage &&
241
- hasClosed && hasVoting && hasVoted && hasRevoked && hasVersion &&
242
- hasBlockHeight && hasnetworkproportion
239
+ hasClosed && hasVoting && hasVoted && hasExpired && hasMissed &&
240
+ hasVersion && hasBlockHeight && hasnetworkproportion
243
241
244
242
if ! hasRequiredFields {
245
243
return fmt .Errorf ("%v: missing required fields: %+v" , infoURL , info )
@@ -254,23 +252,12 @@ func vspStats(service *Service, url string) error {
254
252
vsp .Closed = vspclosed .(bool )
255
253
vsp .Voting = int64 (voting .(float64 ))
256
254
vsp .Voted = int64 (voted .(float64 ))
257
- vsp .Revoked = int64 (revoked .(float64 ))
255
+ vsp .Expired = int64 (expired .(float64 ))
256
+ vsp .Missed = int64 (missed .(float64 ))
258
257
vsp .VspdVersion = version .(string )
259
258
vsp .BlockHeight = uint64 (blockheight .(float64 ))
260
259
vsp .EstimatedNetworkProportion = networkproportion .(float64 )
261
260
262
- // Expired and Missed were introduced in vspd 1.3.0 so they will be absent
263
- // from the responses received from older versions. When every VSP is
264
- // updated to 1.3.0+ these fields can be treated like every other required
265
- // field.
266
- if hasExpired {
267
- vsp .Expired = int64 (expired .(float64 ))
268
- }
269
-
270
- if hasMissed {
271
- vsp .Missed = int64 (missed .(float64 ))
272
- }
273
-
274
261
vsp .LastUpdated = time .Now ().Unix ()
275
262
276
263
service .Mutex .Lock ()
0 commit comments