Skip to content

Commit

Permalink
(NOBIDS) fix sum calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbitfly committed Oct 25, 2023
1 parent 1b5370f commit 2a1a89c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ func getSyncCommitteeSlotsStatistics(validators []uint64, epoch uint64) (types.S
lastExportedEpoch = ((lastExportedDay + 1) * epochsPerDay) - 1
}

err = db.ReaderDb.Get(&syncStats, `SELECT COALESCE(participated_sync_total, 0) AS participated, COALESCE(missed_sync_total, 0) AS missed FROM validator_stats WHERE day = $1 AND validatorindex = ANY($2)`, lastExportedDay, pq.Array(validators))
err = db.ReaderDb.Get(&syncStats, `SELECT SUM(COALESCE(participated_sync_total, 0)) AS participated, SUM(COALESCE(missed_sync_total, 0)) AS missed FROM validator_stats WHERE day = $1 AND validatorindex = ANY($2)`, lastExportedDay, pq.Array(validators))
if err != nil {
return types.SyncCommitteesStats{}, err
}
Expand Down

0 comments on commit 2a1a89c

Please sign in to comment.