Skip to content

Commit

Permalink
Reverse added order and sequence number
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
  • Loading branch information
matthew1001 committed Nov 1, 2023
1 parent e814886 commit 12eb3d5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.hyperledger.besu.plugin.services.MetricsSystem;

import java.time.Clock;
import java.util.Comparator;
import java.util.Iterator;
import java.util.NavigableSet;
import java.util.TreeSet;
Expand All @@ -39,8 +40,8 @@ public class GasPricePendingTransactionsSorter extends AbstractPendingTransactio
new TreeSet<>(
comparing(PendingTransaction::hasPriority)
.thenComparing(PendingTransaction::getGasPrice)
.thenComparing(PendingTransaction::getAddedAt)
.thenComparing(PendingTransaction::getSequence)
.thenComparing(PendingTransaction::getAddedAt, Comparator.reverseOrder())
.thenComparing(PendingTransaction::getSequence, Comparator.reverseOrder())
.reversed());

public GasPricePendingTransactionsSorter(
Expand Down

0 comments on commit 12eb3d5

Please sign in to comment.