Skip to content

Commit

Permalink
fix: leaderboard report order
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Sep 22, 2023
1 parent f6d8102 commit fc8101c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ledger/cmd/webHandlerReport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fc8101c

Please sign in to comment.