utils: fix ineffectual miner config flags (#21271)

Without use of global, these flags didn't actually modify
miner configuration, since we weren't grabbing from the
proper context scope, which should be global (vs. subcommand).

Signed-off-by: meows <b5c6@protonmail.com>
This commit is contained in:
meowsbits 2020-06-30 02:05:25 -05:00 committed by GitHub
parent 02cea2330d
commit c13df14581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1402,10 +1402,10 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
cfg.GasPrice = GlobalBig(ctx, MinerGasPriceFlag.Name) cfg.GasPrice = GlobalBig(ctx, MinerGasPriceFlag.Name)
} }
if ctx.GlobalIsSet(MinerRecommitIntervalFlag.Name) { if ctx.GlobalIsSet(MinerRecommitIntervalFlag.Name) {
cfg.Recommit = ctx.Duration(MinerRecommitIntervalFlag.Name) cfg.Recommit = ctx.GlobalDuration(MinerRecommitIntervalFlag.Name)
} }
if ctx.GlobalIsSet(MinerNoVerfiyFlag.Name) { if ctx.GlobalIsSet(MinerNoVerfiyFlag.Name) {
cfg.Noverify = ctx.Bool(MinerNoVerfiyFlag.Name) cfg.Noverify = ctx.GlobalBool(MinerNoVerfiyFlag.Name)
} }
} }