Merge pull request #872 from gzliudan/fix_etherbase

cmd/utils: not set Etherbase when flag `--unlock` is set
This commit is contained in:
Daniel Liu 2025-02-23 10:00:44 +08:00 committed by GitHub
commit 86e3dbb04d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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())
}
}
}