mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/txpool/legacypool: remove all txs if called with negative gasTip
This commit is contained in:
parent
e648fb5c55
commit
c557960303
1 changed files with 2 additions and 1 deletions
|
|
@ -437,7 +437,8 @@ func (pool *LegacyPool) SetGasTip(tip *big.Int) {
|
||||||
pool.gasTip.Store(new(big.Int).Set(tip))
|
pool.gasTip.Store(new(big.Int).Set(tip))
|
||||||
|
|
||||||
// If the min miner fee increased, remove transactions below the new threshold
|
// If the min miner fee increased, remove transactions below the new threshold
|
||||||
if tip.Cmp(old) > 0 {
|
// if the new tip is negative, remove all transactions
|
||||||
|
if tip.Cmp(old) > 0 || tip.Cmp(new(big.Int)) < 0 {
|
||||||
// pool.priced is sorted by GasFeeCap, so we have to iterate through pool.all instead
|
// pool.priced is sorted by GasFeeCap, so we have to iterate through pool.all instead
|
||||||
drop := pool.all.RemotesBelowTip(tip)
|
drop := pool.all.RemotesBelowTip(tip)
|
||||||
for _, tx := range drop {
|
for _, tx := range drop {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue