MCPcopy Create free account
hub / github.com/CPChain/chain / SetGasPrice

Method SetGasPrice

core/tx_pool.go:571–580  ·  view source on GitHub ↗

SetGasPrice updates the minimum price required by the transaction pool for a new transaction, and drops all transactions below this threshold.

(price *big.Int)

Source from the content-addressed store, hash-verified

569// SetGasPrice updates the minimum price required by the transaction pool for a
570// new transaction, and drops all transactions below this threshold.
571func (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.
583func (pool *TxPool) State() *state.ManagedState {

Calls 6

removeTxMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
HashMethod · 0.65
InfoMethod · 0.65
CapMethod · 0.45