cmd, eth: offer maxprice flag for overwritting price cap (#21531)

* cmd, eth: offer maxprice flag for overwritting price cap

* eth: rename default price cap
This commit is contained in:
gary rong
2020-09-09 23:38:47 +08:00
committed by GitHub
parent 3a98c6f6e6
commit 328901c24c
5 changed files with 27 additions and 3 deletions

View File

@ -631,6 +631,11 @@ var (
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices",
Value: eth.DefaultConfig.GPO.Percentile,
}
GpoMaxGasPriceFlag = cli.Int64Flag{
Name: "gpo.maxprice",
Usage: "Maximum gas price will be recommended by gpo",
Value: eth.DefaultConfig.GPO.MaxPrice.Int64(),
}
WhisperEnabledFlag = cli.BoolFlag{
Name: "shh",
Usage: "Enable Whisper",
@ -1291,6 +1296,9 @@ func setGPO(ctx *cli.Context, cfg *gasprice.Config, light bool) {
if ctx.GlobalIsSet(GpoPercentileFlag.Name) {
cfg.Percentile = ctx.GlobalInt(GpoPercentileFlag.Name)
}
if ctx.GlobalIsSet(GpoMaxGasPriceFlag.Name) {
cfg.MaxPrice = big.NewInt(ctx.GlobalInt64(GpoMaxGasPriceFlag.Name))
}
}
func setTxPool(ctx *cli.Context, cfg *core.TxPoolConfig) {