cmd/utils: not set Etherbase when flag --unlock is set

This commit is contained in:
Daniel Liu 2025-02-19 20:55:32 +08:00
parent 92fb0ca836
commit 77f577a388

View file

@ -1095,7 +1095,10 @@ func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *ethconfig.Config
}
cfg.Etherbase = account.Address
} else {
cfg.Etherbase = common.HexToAddress(ctx.String(MinerEtherbaseFlag.Name))
if !ctx.IsSet(UnlockedAccountFlag.Name) {
cfg.Etherbase = common.HexToAddress(ctx.String(MinerEtherbaseFlag.Name))
log.Info("Set etherbase", "address", cfg.Etherbase.Hex())
}
}
}