Skip to content

Commit

Permalink
Fix isTransactionGreater().
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Oct 31, 2024
1 parent 5a42102 commit d1063be
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions txcache/selectionUsingMerges.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,17 @@ func mergeTwoBunchesOfTransactions(first BunchOfTransactions, second BunchOfTran

// Equality is out of scope (not possible in our case).
func isTransactionGreater(transaction *WrappedTransaction, otherTransaction *WrappedTransaction) bool {
// First, compare by fee (PLS CHANGE TO PPU)
cmpFee := transaction.TxFee.Cmp(otherTransaction.TxFee)
if cmpFee > 0 {
// First, compare by price per unit
if transaction.PricePerGasUnitQuotient > otherTransaction.PricePerGasUnitQuotient {
return true
} else if cmpFee < 0 {
}
if transaction.PricePerGasUnitQuotient < otherTransaction.PricePerGasUnitQuotient {
return false
}
if transaction.PricePerGasUnitRemainder > otherTransaction.PricePerGasUnitRemainder {
return true
}
if transaction.PricePerGasUnitRemainder < otherTransaction.PricePerGasUnitRemainder {
return false
}

Expand Down

0 comments on commit d1063be

Please sign in to comment.