From fc8101cdac5586f3f684dc08d6eb5bcc133870e7 Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Fri, 22 Sep 2023 15:31:21 -0500 Subject: [PATCH] fix: leaderboard report order --- ledger/cmd/webHandlerReport.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ledger/cmd/webHandlerReport.go b/ledger/cmd/webHandlerReport.go index 61972e7c..fb1b3d87 100644 --- a/ledger/cmd/webHandlerReport.go +++ b/ledger/cmd/webHandlerReport.go @@ -246,7 +246,8 @@ func reportHandler(w http.ResponseWriter, r *http.Request, params httprouter.Par } } - slices.SortFunc(values, func(a, b lbAccount) int { return a.Balance.Cmp(b.Balance) }) + // descending (-1 to reverse order) + slices.SortFunc(values, func(a, b lbAccount) int { return -1 * a.Balance.Cmp(b.Balance) }) maxIdx := 0 for idx := range values {