mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-04 10:25:04 +00:00
core/txpool/blobpool: simplify evictionPriority code
evictionPriority was used in only one place, where we cap it to 0. Cleaner to do it right in the function. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
a951aacb70
commit
ba9d3548d4
2 changed files with 1 additions and 10 deletions
|
|
@ -95,13 +95,7 @@ func (h *evictHeap) Less(i, j int) bool {
|
|||
lastJ := txsJ[len(txsJ)-1]
|
||||
|
||||
prioI := evictionPriority(h.basefeeJumps, lastI.evictionExecFeeJumps, h.blobfeeJumps, lastI.evictionBlobFeeJumps)
|
||||
if prioI > 0 {
|
||||
prioI = 0
|
||||
}
|
||||
prioJ := evictionPriority(h.basefeeJumps, lastJ.evictionExecFeeJumps, h.blobfeeJumps, lastJ.evictionBlobFeeJumps)
|
||||
if prioJ > 0 {
|
||||
prioJ = 0
|
||||
}
|
||||
if prioI == prioJ {
|
||||
return lastI.evictionExecTip.Lt(lastJ.evictionExecTip)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,10 +36,7 @@ func evictionPriority(basefeeJumps float64, txBasefeeJumps, blobfeeJumps, txBlob
|
|||
basefeePriority = evictionPriority1D(basefeeJumps, txBasefeeJumps)
|
||||
blobfeePriority = evictionPriority1D(blobfeeJumps, txBlobfeeJumps)
|
||||
)
|
||||
if basefeePriority < blobfeePriority {
|
||||
return basefeePriority
|
||||
}
|
||||
return blobfeePriority
|
||||
return min(0, basefeePriority, blobfeePriority)
|
||||
}
|
||||
|
||||
// evictionPriority1D calculates the eviction priority based on the algorithm
|
||||
|
|
|
|||
Loading…
Reference in a new issue