From d4a808a7056bab059ef8c5d123acd863c31da863 Mon Sep 17 00:00:00 2001 From: Chris Hager Date: Fri, 26 Jul 2024 10:25:51 +0200 Subject: [PATCH] fix GetLatestDeliveredPayload --- database/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/database.go b/database/database.go index 50b35d2..f889388 100644 --- a/database/database.go +++ b/database/database.go @@ -209,7 +209,7 @@ func (s *DatabaseService) GetDeliveredPayloadsForSlot(slot uint64) (res []*DataA func (s *DatabaseService) GetLatestDeliveredPayload() (*DataAPIPayloadDeliveredEntry, error) { query := `SELECT id, inserted_at, relay, epoch, slot, parent_hash, block_hash, builder_pubkey, proposer_pubkey, proposer_fee_recipient, gas_limit, gas_used, value_claimed_wei, value_claimed_eth, num_tx, block_number - FROM ` + vars.TableDataAPIPayloadDelivered + ` WHERE value_check_ok IS NOT NULL ORDER BY id DESC LIMIT 1;` + FROM ` + vars.TableDataAPIPayloadDelivered + ` WHERE value_check_ok IS NOT NULL ORDER BY slot DESC LIMIT 1;` entry := new(DataAPIPayloadDeliveredEntry) err := s.DB.Get(entry, query) return entry, err