mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-24 15:44:32 +00:00
core/txpool: accept non-local transaction with zero tip (#950)
This commit is contained in:
parent
b9a6c8c32d
commit
e974d96977
1 changed files with 10 additions and 3 deletions
|
|
@ -568,7 +568,7 @@ func (pool *TxPool) Pending(enforceTips bool) map[common.Address]types.Transacti
|
|||
txs := list.Flatten()
|
||||
|
||||
// If the miner requests tip enforcement, cap the lists now
|
||||
if enforceTips && !pool.locals.contains(addr) {
|
||||
if enforceTips && pool.priced.urgent.baseFee != nil && !pool.locals.contains(addr) {
|
||||
for i, tx := range txs {
|
||||
if !tx.IsSpecialTransaction() && tx.GasPrice().Cmp(pool.priced.urgent.baseFee) < 0 {
|
||||
txs = txs[:i]
|
||||
|
|
@ -664,8 +664,15 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
|||
return ErrInvalidSender
|
||||
}
|
||||
// Drop non-local transactions under our own minimal accepted gas price or tip
|
||||
if !local && tx.GasTipCapIntCmp(pool.gasPrice) < 0 {
|
||||
if !tx.IsSpecialTransaction() || (pool.IsSigner != nil && !pool.IsSigner(from)) {
|
||||
if !local {
|
||||
isUnderpriced := false
|
||||
if pool.priced.urgent.baseFee != nil {
|
||||
// check tx.GasPrice() when GasTipCap() == 0
|
||||
isUnderpriced = tx.GasPrice().Cmp(pool.priced.urgent.baseFee) < 0
|
||||
} else {
|
||||
isUnderpriced = tx.GasTipCapIntCmp(pool.gasPrice) < 0
|
||||
}
|
||||
if isUnderpriced && (!tx.IsSpecialTransaction() || (pool.IsSigner != nil && !pool.IsSigner(from))) {
|
||||
return ErrUnderpriced
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue