SetGasPrice updates the minimum price required by the transaction pool for a new transaction, and drops all transactions below this threshold.
(price *big.Int)
| 569 | // SetGasPrice updates the minimum price required by the transaction pool for a |
| 570 | // new transaction, and drops all transactions below this threshold. |
| 571 | func (pool *TxPool) SetGasPrice(price *big.Int) { |
| 572 | pool.mu.Lock() |
| 573 | defer pool.mu.Unlock() |
| 574 | |
| 575 | pool.gasPrice = price |
| 576 | for _, tx := range pool.priced.Cap(price, pool.locals) { |
| 577 | pool.removeTx(tx.Hash(), false) |
| 578 | } |
| 579 | log.Info("Transaction pool price threshold updated", "price", price) |
| 580 | } |
| 581 | |
| 582 | // State returns the virtual managed state of the transaction pool. |
| 583 | func (pool *TxPool) State() *state.ManagedState { |