Skip to content

Commit

Permalink
Apply the same reverse sort order as hyperledger#6106 but to the base…
Browse files Browse the repository at this point in the history
… fee sorter

Signed-off-by: Matthew Whitehead <[email protected]>
  • Loading branch information
matthew1001 committed Nov 9, 2023
1 parent 701cbb0 commit aa14251
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public BaseFeePendingTransactionsSorter(
.orElse(Wei.ZERO)
.getAsBigInteger()
.longValue())
.thenComparing(PendingTransaction::getAddedAt)
.thenComparing(PendingTransaction::getSequence)
.thenComparing(PendingTransaction::getSequence, Comparator.reverseOrder())
.reversed());

private final NavigableSet<PendingTransaction> prioritizedTransactionsDynamicRange =
Expand All @@ -87,8 +86,7 @@ public BaseFeePendingTransactionsSorter(
.getMaxFeePerGas()
.map(maxFeePerGas -> maxFeePerGas.getAsBigInteger().longValue())
.orElse(pendingTx.getGasPrice().toLong()))
.thenComparing(PendingTransaction::getAddedAt)
.thenComparing(PendingTransaction::getSequence)
.thenComparing(PendingTransaction::getSequence, Comparator.reverseOrder())
.reversed());

@Override
Expand Down

0 comments on commit aa14251

Please sign in to comment.