mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
add some accidentally-deleted code
This commit is contained in:
parent
444599402d
commit
fc428ad1cc
2 changed files with 18 additions and 7 deletions
|
|
@ -1083,7 +1083,7 @@ func (p *BlobPool) SetGasTip(tip *big.Int) {
|
|||
}
|
||||
|
||||
func (p *BlobPool) FlushAllTransactions() {
|
||||
maxUint256 := new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 256), common.Big1)
|
||||
maxUint256 := uint256.MustFromBig(new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 256), common.Big1))
|
||||
p.lock.Lock()
|
||||
defer p.lock.Unlock()
|
||||
p.flushTransactionsBelowTip(maxUint256)
|
||||
|
|
|
|||
|
|
@ -429,6 +429,15 @@ func (pool *LegacyPool) SubscribeTransactions(ch chan<- core.NewTxsEvent, reorgs
|
|||
return pool.txFeed.Subscribe(ch)
|
||||
}
|
||||
|
||||
func (pool *LegacyPool) flushTransactionsBelowTip(tip *big.Int) {
|
||||
// pool.priced is sorted by GasFeeCap, so we have to iterate through pool.all instead
|
||||
drop := pool.all.RemotesBelowTip(tip)
|
||||
for _, tx := range drop {
|
||||
pool.removeTx(tx.Hash(), false, true)
|
||||
}
|
||||
pool.priced.Removed(len(drop))
|
||||
}
|
||||
|
||||
// SetGasTip updates the minimum gas tip required by the transaction pool for a
|
||||
// new transaction, and drops all transactions below this threshold.
|
||||
func (pool *LegacyPool) SetGasTip(tip *big.Int) {
|
||||
|
|
@ -442,16 +451,18 @@ func (pool *LegacyPool) SetGasTip(tip *big.Int) {
|
|||
pool.gasTip.Store(newTip)
|
||||
// If the min miner fee increased, remove transactions below the new threshold
|
||||
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 {
|
||||
pool.removeTx(tx.Hash(), false, true)
|
||||
}
|
||||
pool.priced.Removed(len(drop))
|
||||
pool.flushTransactionsBelowTip(tip)
|
||||
}
|
||||
log.Info("Legacy pool tip threshold updated", "tip", newTip)
|
||||
}
|
||||
|
||||
func (pool *LegacyPool) FlushAllTransactions() {
|
||||
maxUint256 := new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 256), common.Big1)
|
||||
pool.mu.Lock()q
|
||||
defer pool.mu.Unlock()
|
||||
pool.flushTransactionsBelowTip(maxUint256)
|
||||
}
|
||||
|
||||
// Nonce returns the next nonce of an account, with all transactions executable
|
||||
// by the pool already applied on top.
|
||||
func (pool *LegacyPool) Nonce(addr common.Address) uint64 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue