Skip to content

Commit

Permalink
Added differentiated query for lowest and highest block main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-morlier committed Apr 18, 2024
1 parent b248290 commit db72be7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ func main() {

func runStartupChecks(certainty, heavyCheck bool, database *sql.DB, config *config.Config) {
var earliestBlock, latestBlock uint64
if err := database.QueryRowContext(context.Background(), "SELECT min(number), max(number) FROM blocks.blocks;").Scan(&earliestBlock, &latestBlock); err != nil {
if err := database.QueryRowContext(context.Background(), "SELECT min(number) FROM blocks.blocks;").Scan(&earliestBlock); err != nil {
log.Error("Error aquiring lowest block from blocks db for startup checks", "err", err)
}
if err := database.QueryRowContext(context.Background(), "SELECT max(number) FROM blocks.blocks;").Scan(&latestBlock); err != nil {
log.Error("Error aquiring highest block from blocks db for startup checks", "err", err)
}

Expand Down

0 comments on commit db72be7

Please sign in to comment.