mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
This commit removes two redundant SetGasPrice() calls in the startNode function that were causing multiple issues:
1. Overriding txpool's configured price limit with the miner's gas price setting, mixing two independent configurations:
- cfg.Eth.GasPrice (from --miner-gasprice --gasprice flag)
- cfg.TxPool.PriceLimit (from --txpool-pricelimit flag)
2. Reverting runtime gasPrice changes made via RPC. When users call miner_setGasPrice RPC method to adjust the gasPrice dynamically, the changes would be unexpectedly reverted at the next checkpoint when startNode re-applies cfg.Eth.GasPrice.
The txpool already initializes its gasPrice from config.PriceLimit during construction (core/txpool/txpool.go:333):
```go
func NewTxPool(config Config, chainconfig *params.ChainConfig, chain blockChain) *TxPool {
pool := &TxPool{
gasPrice: new(big.Int).SetUint64(config.PriceLimit),
}
```
When mining is started via RPC (miner_start), the MinerAPI.Start() method handles gasPrice propagation correctly.
This change ensures:
- The txpool respects its own configuration
- Runtime gasPrice adjustments via RPC persist across checkpoints
- No unexpected overriding of user-configured values
|
||
|---|---|---|
| .. | ||
| testdata | ||
| accountcmd.go | ||
| accountcmd_test.go | ||
| chaincmd.go | ||
| config.go | ||
| consolecmd.go | ||
| consolecmd_test.go | ||
| dao_test.go | ||
| dbcmd.go | ||
| main.go | ||
| misccmd.go | ||
| run_test.go | ||
| transactions.rlp | ||