revert a underprice check in txpool (#987)

revert underprice check in txpool
This commit is contained in:
HAOYUatHZ 2024-08-15 10:38:27 +08:00 committed by GitHub
parent 1d331572b6
commit f883ca89cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -748,9 +748,8 @@ func (pool *LegacyPool) add(tx *types.Transaction, local bool) (replaced bool, e
// If the transaction pool is full, discard underpriced transactions // If the transaction pool is full, discard underpriced transactions
if uint64(pool.all.Slots()+numSlots(tx)) > pool.config.GlobalSlots+pool.config.GlobalQueue { if uint64(pool.all.Slots()+numSlots(tx)) > pool.config.GlobalSlots+pool.config.GlobalQueue {
// If the new transaction is underpriced, don't accept it // If the new transaction is underpriced, don't accept it
// if !isLocal && pool.priced.Underpriced(tx) { if !isLocal && pool.priced.Underpriced(tx) {
if !isLocal && tx.GasFeeCapIntCmp(pool.gasTip.Load()) < 0 { log.Trace("Discarding underpriced transaction", "hash", hash, "gasTipCap", tx.GasTipCap(), "gasFeeCap", tx.GasFeeCap())
log.Trace("Discarding underpriced transaction", "hash", hash, "gasTipCap", tx.GasTipCap(), "gasFeeCap", tx.GasFeeCap(), "txPoolGasTip", pool.gasTip.Load())
underpricedTxMeter.Mark(1) underpricedTxMeter.Mark(1)
return false, txpool.ErrUnderpriced return false, txpool.ErrUnderpriced
} }