mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
eth/catalyst: properly flush txs
This commit is contained in:
parent
c557960303
commit
7ab3038951
2 changed files with 3 additions and 3 deletions
|
|
@ -437,8 +437,7 @@ func (pool *LegacyPool) SetGasTip(tip *big.Int) {
|
|||
pool.gasTip.Store(new(big.Int).Set(tip))
|
||||
|
||||
// If the min miner fee increased, remove transactions below the new threshold
|
||||
// if the new tip is negative, remove all transactions
|
||||
if tip.Cmp(old) > 0 || tip.Cmp(new(big.Int)) < 0 {
|
||||
if tip.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 {
|
||||
|
|
|
|||
|
|
@ -285,7 +285,8 @@ func (c *SimulatedBeacon) Commit() common.Hash {
|
|||
// Rollback un-sends previously added transactions.
|
||||
func (c *SimulatedBeacon) Rollback() {
|
||||
// Flush all transactions from the transaction pools
|
||||
c.eth.TxPool().SetGasTip(big.NewInt(-1))
|
||||
maxUint256 := new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 256), common.Big1)
|
||||
c.eth.TxPool().SetGasTip(maxUint256)
|
||||
// Set the gas tip back to accept new transactions
|
||||
// TODO (Marius van der Wijden): set gas tip to parameter passed by config
|
||||
c.eth.TxPool().SetGasTip(big.NewInt(params.GWei))
|
||||
|
|
|
|||
Loading…
Reference in a new issue