Return foreign-chain wallet transactions in newest-timestamp-first order

This commit is contained in:
catbref 2021-01-08 17:37:12 +00:00
parent f3e1f088f8
commit 385064e324

View File

@ -377,7 +377,9 @@ public abstract class Bitcoiny implements ForeignBlockchain {
// Process new keys // Process new keys
} while (true); } while (true);
return walletTransactions.stream().collect(Collectors.toList()); Comparator<BitcoinyTransaction> newestTimestampFirstComparator = Comparator.comparingInt((BitcoinyTransaction txn) -> txn.timestamp).reversed();
return walletTransactions.stream().sorted(newestTimestampFirstComparator).collect(Collectors.toList());
} }
/** /**