core: check effective tip in txpool pricelimit validation (#23855)

This commit is contained in:
Daniel Liu 2024-05-31 11:25:25 +08:00
parent 81dff92ced
commit 6feb71e5c8

View file

@ -673,8 +673,9 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
if err != nil { if err != nil {
return ErrInvalidSender return ErrInvalidSender
} }
// Drop non-local transactions under our own minimal accepted gas price or tip // Drop non-local transactions under our own minimal accepted gas price or tip.
if !local && tx.GasTipCapIntCmp(pool.gasPrice) < 0 { pendingBaseFee := pool.priced.urgent.baseFee
if !local && tx.EffectiveGasTipIntCmp(pool.gasPrice, pendingBaseFee) < 0 {
if !tx.IsSpecialTransaction() || (pool.IsSigner != nil && !pool.IsSigner(from)) { if !tx.IsSpecialTransaction() || (pool.IsSigner != nil && !pool.IsSigner(from)) {
return ErrUnderpriced return ErrUnderpriced
} }