code: func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) {
  	// Extract the current etherbase, new flag overriding legacy one
  	var etherbase string
  	if ctx.GlobalIsSet(MinerLegacyEtherbaseFlag.Name) {
  		etherbase = ctx.GlobalString(MinerLegacyEtherbaseFlag.Name)
  	}
  	if ctx.GlobalIsSet(MinerEtherbaseFlag.Name) {
  		etherbase = ctx.GlobalString(MinerEtherbaseFlag.Name)
  	}
  	// Convert the etherbase into an address and configure it
  	if etherbase != "" {
  		if ks != nil {
  			account, err := MakeAddress(ks, etherbase)
  			if err != nil {
  				Fatalf("Invalid miner etherbase: %v", err)
  			}
  			cfg.Miner.Etherbase = account.Address
  		} else {
  			Fatalf("No etherbase configured")
  		}
  	}
  }
docs: // setEtherbase retrieves the etherbase either from the directly specified
  // command line flags or from the keystore if CLI indexed.