Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
Fix parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
somnathb1 committed Sep 17, 2023
1 parent c01aa0d commit 485e52c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions txpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1516,9 +1516,7 @@ func onSenderStateChange(senderID uint64, senderNonce uint64, senderBalance uint
func promote(pending *PendingPool, baseFee, queued *SubPool, pendingBaseFee uint64, pendingBlobFee uint64, discard func(*metaTx, txpoolcfg.DiscardReason), announcements *types.Announcements,
logger log.Logger) {
// Demote worst transactions that do not qualify for pending sub pool anymore, to other sub pools, or discard
for worst := pending.Worst(); pending.Len() > 0 &&
(worst.subPool < BaseFeePoolBits || worst.minFeeCap.Uint64() < pendingBaseFee) ||
(worst.Tx.Type == types.BlobTxType && worst.Tx.BlobFeeCap.Uint64() < pendingBlobFee); worst = pending.Worst() {
for worst := pending.Worst(); pending.Len() > 0 && (worst.subPool < BaseFeePoolBits || worst.minFeeCap.Uint64() < pendingBaseFee || (worst.Tx.Type == types.BlobTxType && worst.Tx.BlobFeeCap.Uint64() < pendingBlobFee)); worst = pending.Worst() {
if worst.subPool >= BaseFeePoolBits {
tx := pending.PopWorst()
announcements.Append(tx.Tx.Type, tx.Tx.Size, tx.Tx.IDHash[:])
Expand All @@ -1531,10 +1529,7 @@ func promote(pending *PendingPool, baseFee, queued *SubPool, pendingBaseFee uint
}

// Promote best transactions from base fee pool to pending pool while they qualify
for best := baseFee.Best(); baseFee.Len() > 0 &&
best.subPool >= BaseFeePoolBits && best.minFeeCap.Uint64() >= pendingBaseFee &&
(best.Tx.Type == types.BlobTxType && best.Tx.BlobFeeCap.Uint64() >= pendingBlobFee ||
best.Tx.Type != types.BlobTxType); best = baseFee.Best() {
for best := baseFee.Best(); baseFee.Len() > 0 && best.subPool >= BaseFeePoolBits && best.minFeeCap.Uint64() >= pendingBaseFee && (best.Tx.Type != types.BlobTxType || best.Tx.BlobFeeCap.Uint64() >= pendingBlobFee); best = baseFee.Best() {
tx := baseFee.PopBest()
announcements.Append(tx.Tx.Type, tx.Tx.Size, tx.Tx.IDHash[:])
pending.Add(tx, logger)
Expand Down

0 comments on commit 485e52c

Please sign in to comment.