Reverse sort order (#6106)

* 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>
pull/6148/head
Matt Whitehead 1 year ago committed by GitHub
parent 914ab792ea
commit 0203092d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/GasPricePendingTransactionsSorter.java

@ -22,6 +22,7 @@ import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfigurati
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;
@ -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(

Loading…
Cancel
Save