If you had 2 Transactions that had the same timestamp the sort could be unstable and could cause annoying issues. Now it will compare the ids if they are equal and should always have a stable sorting implementation now.
@@ -246,7 +246,10 @@ impl PartialOrd for Transaction {
impl Ord for Transaction {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
- self.timestamp.cmp(&other.timestamp).reverse()
+ self.timestamp
+ .cmp(&other.timestamp)
+ .reverse()
+ .then_with(|| self.id().cmp(&other.id()))
}