Skip to content

Commit

Permalink
Reverse sort order (#6106)
Browse files Browse the repository at this point in the history
* Reverse added order and sequence number

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Remove extraneous 'addedAt' check

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

---------

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
  • Loading branch information
matthew1001 authored Nov 8, 2023
1 parent 914ab79 commit 0203092
Showing 1 changed file with 2 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,7 @@ public class GasPricePendingTransactionsSorter extends AbstractPendingTransactio
new TreeSet<>(
comparing(PendingTransaction::hasPriority)
.thenComparing(PendingTransaction::getGasPrice)
.thenComparing(PendingTransaction::getAddedAt)
.thenComparing(PendingTransaction::getSequence)
.thenComparing(PendingTransaction::getSequence, Comparator.reverseOrder())
.reversed());

public GasPricePendingTransactionsSorter(
Expand Down

0 comments on commit 0203092

Please sign in to comment.