Skip to content

Commit

Permalink
Merge pull request #2662 from gobitfly/NOBIDS/praterReexportTool
Browse files Browse the repository at this point in the history
Nobids/prater reexport tool
  • Loading branch information
recy21 authored Nov 2, 2023
2 parents 2e6590b + 3d891c1 commit 2402176
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/misc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,13 +1073,14 @@ OUTER:

// get max validator index for day
firstEpoch, _ := utils.GetFirstAndLastEpochForDay(day + 1)
maxValidatorIndex, err := db.BigtableClient.GetMaxValidatorindexForEpoch(firstEpoch)
var maxValidatorIndex uint64
err := db.ReaderDb.Get(&maxValidatorIndex, `SELECT MAX(validatorindex) FROM validator_stats WHERE day = $1`, day)
if err != nil {
utils.LogFatal(err, "error in GetMaxValidatorindexForEpoch: could not get max validator index", 0, map[string]interface{}{
utils.LogFatal(err, "error: could not get max validator index", 0, map[string]interface{}{
"epoch": firstEpoch,
})
} else if maxValidatorIndex == uint64(0) {
utils.LogFatal(err, "error in GetMaxValidatorindexForEpoch: no validator found", 0, map[string]interface{}{
utils.LogFatal(err, "error: no validator found", 0, map[string]interface{}{
"epoch": firstEpoch,
})
}
Expand Down

0 comments on commit 2402176

Please sign in to comment.