From db72be765fc56807d8546e5080b6cd72ab59d0f1 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Thu, 18 Apr 2024 12:00:51 -0700 Subject: [PATCH] Added differentiated query for lowest and highest block main.go --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 75f78e5..a67cad8 100644 --- a/main.go +++ b/main.go @@ -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) }