cmd/geth: fix ctx.IsSet return true even flags like --sepolia=false

This commit is contained in:
Weixie Cui 2026-05-13 20:07:09 +08:00
parent 21c5a287f9
commit 9e4753b86e

View file

@ -303,13 +303,13 @@ func main() {
func prepare(ctx *cli.Context) {
// If we're running a known preset, log it for convenience.
switch {
case ctx.IsSet(utils.SepoliaFlag.Name):
case ctx.Bool(utils.SepoliaFlag.Name):
log.Info("Starting Geth on Sepolia testnet...")
case ctx.IsSet(utils.HoleskyFlag.Name):
case ctx.Bool(utils.HoleskyFlag.Name):
log.Info("Starting Geth on Holesky testnet...")
case ctx.IsSet(utils.HoodiFlag.Name):
case ctx.Bool(utils.HoodiFlag.Name):
log.Info("Starting Geth on Hoodi testnet...")
case !ctx.IsSet(utils.NetworkIdFlag.Name):