From aff1586411b05a9235e6f799117967ce82b448c3 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 10 Dec 2022 15:51:00 +0000 Subject: [PATCH] Fix ordering of latest blocks --- web-api/src/database/blocks.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web-api/src/database/blocks.rs b/web-api/src/database/blocks.rs index 0bb608b..5b8d1b8 100644 --- a/web-api/src/database/blocks.rs +++ b/web-api/src/database/blocks.rs @@ -52,8 +52,8 @@ pub async fn fetch_latest_blocks( let query = " SELECT blocks.*, - tx.count, - tx.weight, + tx.count AS tx_count, + tx.weight AS tx_weight, ( SELECT script FROM transactions @@ -71,7 +71,7 @@ pub async fn fetch_latest_blocks( FROM transactions WHERE transactions.block_id = blocks.id ) tx ON true - ORDER BY blocks.height + ORDER BY blocks.height DESC LIMIT $1 OFFSET $2 "; -- libgit2 1.7.2