Skip to content

Commit

Permalink
Merge pull request #175 from dystophia/sorted_address_page
Browse files Browse the repository at this point in the history
Sorted entries on address page
  • Loading branch information
fireduck64 committed Oct 3, 2020
2 parents 0abd8b9 + c96d467 commit 4da5fec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion shackleton/src/AddressPage.java
Expand Up @@ -4,6 +4,7 @@
import java.io.PrintStream;
import java.text.DecimalFormat;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import snowblossom.client.GetUTXOUtil;
Expand Down Expand Up @@ -57,7 +58,12 @@ public void render()

LinkedList<HistoryEntry> entries = new LinkedList<>();
entries.addAll(history.getEntriesList());
Collections.reverse(entries);
//Collections.reverse(entries);
Collections.sort(entries, new Comparator<HistoryEntry>() {
public int compare(HistoryEntry s1, HistoryEntry s2) {
return s2.getBlockHeight() - s1.getBlockHeight();
}
});
for(HistoryEntry he : entries)
{
int height = he.getBlockHeight();
Expand Down

0 comments on commit 4da5fec

Please sign in to comment.