mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/txpool/legacypool: fix flaw in settip
This commit is contained in:
parent
0099b0523a
commit
a5962f1cfd
1 changed files with 5 additions and 3 deletions
|
|
@ -434,11 +434,13 @@ func (pool *LegacyPool) SetGasTip(tip *big.Int) {
|
|||
pool.mu.Lock()
|
||||
defer pool.mu.Unlock()
|
||||
|
||||
newTip := uint256.MustFromBig(tip)
|
||||
var (
|
||||
newTip = uint256.MustFromBig(tip)
|
||||
old = pool.gasTip.Load()
|
||||
)
|
||||
pool.gasTip.Store(newTip)
|
||||
|
||||
// If the min miner fee increased, remove transactions below the new threshold
|
||||
if old := pool.gasTip.Load(); newTip.Cmp(old) > 0 {
|
||||
if newTip.Cmp(old) > 0 {
|
||||
// pool.priced is sorted by GasFeeCap, so we have to iterate through pool.all instead
|
||||
drop := pool.all.RemotesBelowTip(tip)
|
||||
for _, tx := range drop {
|
||||
|
|
|
|||
Loading…
Reference in a new issue