diff --git a/README.md b/README.md index 61e36afec4..0272eb2b70 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Specifying the `--testnet` flag however will reconfigure your Geth instance a bi `geth attach /testnet/geth.ipc`. Windows users are not affected by this. * Instead of connecting the main Ethereum network, the client will connect to the test network, which uses different P2P bootnodes, different network IDs and genesis states. - + *Note: Although there are some internal protective measures to prevent transactions from crossing over between the main network and test network, you should make sure to always use separate accounts for play-money and real-money. Unless you manually move accounts, Geth will by default correctly @@ -263,11 +263,11 @@ resources (consider running on a single thread, no need for multiple ones either instance for mining, run it with all your usual flags, extended by: ``` -$ geth --mine --minerthreads=1 --etherbase=0x0000000000000000000000000000000000000000 +$ geth --mine --minerthreads=1 --coinbase=0x0000000000000000000000000000000000000000 ``` Which will start mining blocks and transactions on a single CPU thread, crediting all proceedings to -the account specified by `--etherbase`. You can further tune the mining by changing the default gas +the account specified by `--coinbase`. You can further tune the mining by changing the default gas limit blocks converge to (`--targetgaslimit`) and the price transactions are accepted at (`--gasprice`). ## Contribution diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index 258b9e6dd9..8efb1deb23 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -43,7 +43,7 @@ func TestConsoleWelcome(t *testing.T) { // Start a geth console, make sure it's cleaned up and terminate the console geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--shh", + "--coinbase", coinbase, "--shh", "console") // Gather all the infos the welcome message needs to contain @@ -59,7 +59,7 @@ func TestConsoleWelcome(t *testing.T) { Welcome to the Geth JavaScript console! instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} -coinbase: {{.Etherbase}} +coinbase: {{.Coinbase}} at block: 0 ({{niltime}}) datadir: {{.Datadir}} modules: {{apis}} @@ -85,7 +85,7 @@ func TestIPCAttachWelcome(t *testing.T) { // list of ipc modules and shh is included there. geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--shh", "--ipcpath", ipc) + "--coinbase", coinbase, "--shh", "--ipcpath", ipc) time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open testAttachWelcome(t, geth, "ipc:"+ipc, ipcAPIs) @@ -99,7 +99,7 @@ func TestHTTPAttachWelcome(t *testing.T) { port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--rpc", "--rpcport", port) + "--coinbase", coinbase, "--rpc", "--rpcport", port) time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open testAttachWelcome(t, geth, "http://localhost:"+port, httpAPIs) @@ -114,7 +114,7 @@ func TestWSAttachWelcome(t *testing.T) { geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--ws", "--wsport", port) + "--coinbase", coinbase, "--ws", "--wsport", port) time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open testAttachWelcome(t, geth, "ws://localhost:"+port, httpAPIs) @@ -134,7 +134,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { attach.SetTemplateFunc("goarch", func() string { return runtime.GOARCH }) attach.SetTemplateFunc("gover", runtime.Version) attach.SetTemplateFunc("gethver", func() string { return params.Version }) - attach.SetTemplateFunc("etherbase", func() string { return geth.Etherbase }) + attach.SetTemplateFunc("coinbase", func() string { return geth.Coinbase }) attach.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) }) attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") }) attach.SetTemplateFunc("datadir", func() string { return geth.Datadir }) @@ -145,7 +145,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { Welcome to the Geth JavaScript console! instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} -coinbase: {{etherbase}} +coinbase: {{coinbase}} at block: 0 ({{niltime}}){{if ipc}} datadir: {{datadir}}{{end}} modules: {{apis}} diff --git a/cmd/geth/main.go b/cmd/geth/main.go index bdb7fad62a..339daed579 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -93,7 +93,7 @@ var ( utils.ListenPortFlag, utils.MaxPeersFlag, utils.MaxPendingPeersFlag, - utils.EtherbaseFlag, + utils.CoinbaseFlag, utils.GasPriceFlag, utils.MinerThreadsFlag, utils.MiningEnabledFlag, diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index da82facac3..dd8b2c7cbe 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -38,8 +38,8 @@ type testgeth struct { *cmdtest.TestCmd // template variables for expect - Datadir string - Etherbase string + Datadir string + Coinbase string } func init() { @@ -72,9 +72,13 @@ func runGeth(t *testing.T, args ...string) *testgeth { if i < len(args)-1 { tt.Datadir = args[i+1] } + case arg == "-coinbase" || arg == "--coinbase": + if i < len(args)-1 { + tt.Coinbase = args[i+1] + } case arg == "-etherbase" || arg == "--etherbase": if i < len(args)-1 { - tt.Etherbase = args[i+1] + tt.Coinbase = args[i+1] } } } diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index a834d5b7ae..94977053de 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -179,7 +179,7 @@ var AppHelpFlagGroups = []flagGroup{ Flags: []cli.Flag{ utils.MiningEnabledFlag, utils.MinerThreadsFlag, - utils.EtherbaseFlag, + utils.CoinbaseFlag, utils.TargetGasLimitFlag, utils.GasPriceFlag, utils.ExtraDataFlag, diff --git a/cmd/puppeth/module_node.go b/cmd/puppeth/module_node.go index 69cb19c349..8ec17289ca 100644 --- a/cmd/puppeth/module_node.go +++ b/cmd/puppeth/module_node.go @@ -42,7 +42,7 @@ ADD genesis.json /genesis.json RUN \ echo 'geth --cache 512 init /genesis.json' > geth.sh && \{{if .Unlock}} echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> geth.sh && \{{end}} - echo $'geth --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .BootV4}}--bootnodesv4 {{.BootV4}}{{end}} {{if .BootV5}}--bootnodesv5 {{.BootV5}}{{end}} {{if .Etherbase}}--etherbase {{.Etherbase}} --mine --minerthreads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --targetgaslimit {{.GasTarget}} --gasprice {{.GasPrice}}' >> geth.sh + echo $'geth --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .BootV4}}--bootnodesv4 {{.BootV4}}{{end}} {{if .BootV5}}--bootnodesv5 {{.BootV5}}{{end}} {{if .Coinbase}}--coinbase {{.Coinbase}} --mine --minerthreads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --targetgaslimit {{.GasTarget}} --gasprice {{.GasPrice}}' >> geth.sh ENTRYPOINT ["/bin/sh", "geth.sh"] ` @@ -68,7 +68,7 @@ services: - TOTAL_PEERS={{.TotalPeers}} - LIGHT_PEERS={{.LightPeers}} - STATS_NAME={{.Ethstats}} - - MINER_NAME={{.Etherbase}} + - MINER_NAME={{.Coinbase}} - GAS_TARGET={{.GasTarget}} - GAS_PRICE={{.GasPrice}} logging: @@ -84,7 +84,7 @@ services: // already exists there, it will be overwritten! func deployNode(client *sshClient, network string, bootv4, bootv5 []string, config *nodeInfos, nocache bool) ([]byte, error) { kind := "sealnode" - if config.keyJSON == "" && config.etherbase == "" { + if config.keyJSON == "" && config.coinbase == "" { kind = "bootnode" bootv4 = make([]string, 0) bootv5 = make([]string, 0) @@ -106,7 +106,7 @@ func deployNode(client *sshClient, network string, bootv4, bootv5 []string, conf "BootV4": strings.Join(bootv4, ","), "BootV5": strings.Join(bootv5, ","), "Ethstats": config.ethstats, - "Etherbase": config.etherbase, + "Coinbase": config.coinbase, "GasTarget": uint64(1000000 * config.gasTarget), "GasPrice": uint64(1000000000 * config.gasPrice), "Unlock": config.keyJSON != "", @@ -125,7 +125,7 @@ func deployNode(client *sshClient, network string, bootv4, bootv5 []string, conf "LightPort": config.portFull + 1, "LightPeers": config.peersLight, "Ethstats": config.ethstats[:strings.Index(config.ethstats, ":")], - "Etherbase": config.etherbase, + "Coinbase": config.coinbase, "GasTarget": config.gasTarget, "GasPrice": config.gasPrice, }) @@ -163,7 +163,7 @@ type nodeInfos struct { enodeLight string peersTotal int peersLight int - etherbase string + coinbase string keyJSON string keyPass string gasTarget float64 @@ -189,10 +189,10 @@ func (info *nodeInfos) Report() map[string]string { report["Gas limit (baseline target)"] = fmt.Sprintf("%0.3f MGas", info.gasTarget) report["Gas price (minimum accepted)"] = fmt.Sprintf("%0.3f GWei", info.gasPrice) - if info.etherbase != "" { + if info.coinbase != "" { // Ethash proof-of-work miner report["Ethash directory"] = info.ethashdir - report["Miner account"] = info.etherbase + report["Miner account"] = info.coinbase } if info.keyJSON != "" { // Clique proof-of-authority signer @@ -264,7 +264,7 @@ func checkNode(client *sshClient, network string, boot bool) (*nodeInfos, error) peersTotal: totalPeers, peersLight: lightPeers, ethstats: infos.envvars["STATS_NAME"], - etherbase: infos.envvars["MINER_NAME"], + coinbase: infos.envvars["MINER_NAME"], keyJSON: keyJSON, keyPass: keyPass, gasTarget: gasTarget, diff --git a/cmd/puppeth/wizard_node.go b/cmd/puppeth/wizard_node.go index 097e2e41aa..bd7845c697 100644 --- a/cmd/puppeth/wizard_node.go +++ b/cmd/puppeth/wizard_node.go @@ -104,19 +104,19 @@ func (w *wizard) deployNode(boot bool) { // If the node is a miner/signer, load up needed credentials if !boot { if w.conf.Genesis.Config.Ethash != nil { - // Ethash based miners only need an etherbase to mine against + // Ethash based miners only need an coinbase to mine against fmt.Println() - if infos.etherbase == "" { + if infos.coinbase == "" { fmt.Printf("What address should the miner user?\n") for { if address := w.readAddress(); address != nil { - infos.etherbase = address.Hex() + infos.coinbase = address.Hex() break } } } else { - fmt.Printf("What address should the miner user? (default = %s)\n", infos.etherbase) - infos.etherbase = w.readDefaultAddress(common.HexToAddress(infos.etherbase)).Hex() + fmt.Printf("What address should the miner user? (default = %s)\n", infos.coinbase) + infos.coinbase = w.readDefaultAddress(common.HexToAddress(infos.coinbase)).Hex() } } else if w.conf.Genesis.Config.Clique != nil { // If a previous signer was already set, offer to reuse it diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 30edf199c9..db91983435 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -315,8 +315,8 @@ var ( Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine", Value: params.GenesisGasLimit.Uint64(), } - EtherbaseFlag = cli.StringFlag{ - Name: "etherbase", + CoinbaseFlag = cli.StringFlag{ + Name: "coinbase", Usage: "Public address for block mining rewards (default = first account created)", Value: "0", } @@ -759,15 +759,15 @@ func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error return accs[index], nil } -// setEtherbase retrieves the etherbase either from the directly specified +// setCoinbase retrieves the coinbase either from the directly specified // command line flags or from the keystore if CLI indexed. -func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) { - if ctx.GlobalIsSet(EtherbaseFlag.Name) { - account, err := MakeAddress(ks, ctx.GlobalString(EtherbaseFlag.Name)) +func setCoinbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) { + if ctx.GlobalIsSet(CoinbaseFlag.Name) { + account, err := MakeAddress(ks, ctx.GlobalString(CoinbaseFlag.Name)) if err != nil { - Fatalf("Option %q: %v", EtherbaseFlag.Name, err) + Fatalf("Option %q: %v", CoinbaseFlag.Name, err) } - cfg.Etherbase = account.Address + cfg.Coinbase = account.Address } } @@ -985,7 +985,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { checkExclusive(ctx, LightServFlag, SyncModeFlag, "light") ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) - setEtherbase(ctx, ks, cfg) + setCoinbase(ctx, ks, cfg) setGPO(ctx, &cfg.GPO) setTxPool(ctx, &cfg.TxPool) setEthash(ctx, cfg) diff --git a/console/console_test.go b/console/console_test.go index 7b1629c032..2191b58bed 100644 --- a/console/console_test.go +++ b/console/console_test.go @@ -96,8 +96,8 @@ func newTester(t *testing.T, confOverride func(*eth.Config)) *tester { t.Fatalf("failed to create node: %v", err) } ethConf := ð.Config{ - Genesis: core.DeveloperGenesisBlock(15, common.Address{}), - Etherbase: common.HexToAddress(testAddress), + Genesis: core.DeveloperGenesisBlock(15, common.Address{}), + Coinbase: common.HexToAddress(testAddress), Ethash: ethash.Config{ PowMode: ethash.ModeTest, }, diff --git a/eth/api.go b/eth/api.go index 0db3eb5548..3b2bc1069b 100644 --- a/eth/api.go +++ b/eth/api.go @@ -49,14 +49,14 @@ func NewPublicEthereumAPI(e *Ethereum) *PublicEthereumAPI { return &PublicEthereumAPI{e} } -// Etherbase is the address that mining rewards will be send to +// Etherbase is the address that mining rewards will be send to (alias for Coinbase) func (api *PublicEthereumAPI) Etherbase() (common.Address, error) { - return api.e.Etherbase() + return api.Coinbase() } -// Coinbase is the address that mining rewards will be send to (alias for Etherbase) +// Coinbase is the address that mining rewards will be send to ( func (api *PublicEthereumAPI) Coinbase() (common.Address, error) { - return api.Etherbase() + return api.e.Coinbase() } // Hashrate returns the POW hashrate @@ -187,9 +187,9 @@ func (api *PrivateMinerAPI) SetGasPrice(gasPrice hexutil.Big) bool { return true } -// SetEtherbase sets the etherbase of the miner -func (api *PrivateMinerAPI) SetEtherbase(etherbase common.Address) bool { - api.e.SetEtherbase(etherbase) +// SetCoinbase sets the coinbase of the miner +func (api *PrivateMinerAPI) SetCoinbase(coinbase common.Address) bool { + api.e.SetCoinbase(coinbase) return true } diff --git a/eth/backend.go b/eth/backend.go index c39974a2c0..3f972e1cc2 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -84,14 +84,14 @@ type Ethereum struct { ApiBackend *EthApiBackend - miner *miner.Miner - gasPrice *big.Int - etherbase common.Address + miner *miner.Miner + gasPrice *big.Int + coinbase common.Address networkId uint64 netRPCService *ethapi.PublicNetAPI - lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase) + lock sync.RWMutex // Protects the variadic fields (e.g. gas price and coinbase) } func (s *Ethereum) AddLesServer(ls LesServer) { @@ -130,7 +130,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { stopDbUpgrade: stopDbUpgrade, networkId: config.NetworkId, gasPrice: config.GasPrice, - etherbase: config.Etherbase, + coinbase: config.Coinbase, bloomRequests: make(chan chan *bloombits.Retrieval), bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks), } @@ -300,48 +300,49 @@ func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) { s.blockchain.ResetWithGenesisBlock(gb) } -func (s *Ethereum) Etherbase() (eb common.Address, err error) { +func (s *Ethereum) Coinbase() (eb common.Address, err error) { s.lock.RLock() - etherbase := s.etherbase + coinbase := s.coinbase s.lock.RUnlock() - if etherbase != (common.Address{}) { - return etherbase, nil + if coinbase != (common.Address{}) { + return coinbase, nil } if wallets := s.AccountManager().Wallets(); len(wallets) > 0 { if accounts := wallets[0].Accounts(); len(accounts) > 0 { - etherbase := accounts[0].Address + coinbase := accounts[0].Address s.lock.Lock() - s.etherbase = etherbase + s.coinbase = coinbase s.lock.Unlock() - log.Info("Etherbase automatically configured", "address", etherbase) - return etherbase, nil + log.Info("Coinbase automatically configured", "address", coinbase) + return coinbase, nil } } - return common.Address{}, fmt.Errorf("etherbase must be explicitly specified") + + return common.Address{}, fmt.Errorf("coinbase address must be explicitly specified") } // set in js console via admin interface or wrapper from cli flags -func (self *Ethereum) SetEtherbase(etherbase common.Address) { +func (self *Ethereum) SetCoinbase(coinbase common.Address) { self.lock.Lock() - self.etherbase = etherbase + self.coinbase = coinbase self.lock.Unlock() - self.miner.SetEtherbase(etherbase) + self.miner.SetCoinbase(coinbase) } func (s *Ethereum) StartMining(local bool) error { - eb, err := s.Etherbase() + eb, err := s.Coinbase() if err != nil { - log.Error("Cannot start mining without etherbase", "err", err) - return fmt.Errorf("etherbase missing: %v", err) + log.Error("Cannot start mining without coinbase", "err", err) + return fmt.Errorf("coinbase missing: %v", err) } if clique, ok := s.engine.(*clique.Clique); ok { wallet, err := s.accountManager.Find(accounts.Account{Address: eb}) if wallet == nil || err != nil { - log.Error("Etherbase account unavailable locally", "err", err) + log.Error("Coinbase account unavailable locally", "err", err) return fmt.Errorf("signer missing: %v", err) } clique.Authorize(eb, wallet.SignHash) diff --git a/eth/config.go b/eth/config.go index 383cd6783c..995253defa 100644 --- a/eth/config.go +++ b/eth/config.go @@ -89,7 +89,7 @@ type Config struct { DatabaseCache int // Mining-related options - Etherbase common.Address `toml:",omitempty"` + Coinbase common.Address `toml:",omitempty"` MinerThreads int `toml:",omitempty"` ExtraData []byte `toml:",omitempty"` GasPrice *big.Int diff --git a/eth/gen_config.go b/eth/gen_config.go index e2d50e1f66..75da976f6d 100644 --- a/eth/gen_config.go +++ b/eth/gen_config.go @@ -24,7 +24,7 @@ func (c Config) MarshalTOML() (interface{}, error) { SkipBcVersionCheck bool `toml:"-"` DatabaseHandles int `toml:"-"` DatabaseCache int - Etherbase common.Address `toml:",omitempty"` + Coinbase common.Address `toml:",omitempty"` MinerThreads int `toml:",omitempty"` ExtraData hexutil.Bytes `toml:",omitempty"` GasPrice *big.Int @@ -49,7 +49,7 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.SkipBcVersionCheck = c.SkipBcVersionCheck enc.DatabaseHandles = c.DatabaseHandles enc.DatabaseCache = c.DatabaseCache - enc.Etherbase = c.Etherbase + enc.Coinbase = c.Coinbase enc.MinerThreads = c.MinerThreads enc.ExtraData = c.ExtraData enc.GasPrice = c.GasPrice @@ -78,7 +78,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { SkipBcVersionCheck *bool `toml:"-"` DatabaseHandles *int `toml:"-"` DatabaseCache *int - Etherbase *common.Address `toml:",omitempty"` + Coinbase *common.Address `toml:",omitempty"` MinerThreads *int `toml:",omitempty"` ExtraData hexutil.Bytes `toml:",omitempty"` GasPrice *big.Int @@ -122,8 +122,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.DatabaseCache != nil { c.DatabaseCache = *dec.DatabaseCache } - if dec.Etherbase != nil { - c.Etherbase = *dec.Etherbase + if dec.Coinbase != nil { + c.Coinbase = *dec.Coinbase } if dec.MinerThreads != nil { c.MinerThreads = *dec.MinerThreads diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index e11aa402f5..0aa0832cef 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -449,8 +449,8 @@ web3._extend({ call: 'miner_stop' }), new web3._extend.Method({ - name: 'setEtherbase', - call: 'miner_setEtherbase', + name: 'setCoinbase', + call: 'miner_setCoinbase', params: 1, inputFormatter: [web3._extend.formatters.inputAddressFormatter] }), diff --git a/les/backend.go b/les/backend.go index 7180b81d76..81c906fbb3 100644 --- a/les/backend.go +++ b/les/backend.go @@ -150,12 +150,12 @@ func lesTopic(genesisHash common.Hash, protocolVersion uint) discv5.Topic { type LightDummyAPI struct{} -// Etherbase is the address that mining rewards will be send to +// Etherbase is the address that mining rewards will be send to (alias for Coinbase) func (s *LightDummyAPI) Etherbase() (common.Address, error) { return common.Address{}, fmt.Errorf("not supported") } -// Coinbase is the address that mining rewards will be send to (alias for Etherbase) +// Coinbase is the address that mining rewards will be send to func (s *LightDummyAPI) Coinbase() (common.Address, error) { return common.Address{}, fmt.Errorf("not supported") } diff --git a/miner/miner.go b/miner/miner.go index fec0a40f5a..43a264d120 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -105,7 +105,7 @@ out: func (self *Miner) Start(coinbase common.Address) { atomic.StoreInt32(&self.shouldStart, 1) - self.worker.setEtherbase(coinbase) + self.worker.setCoinbase(coinbase) self.coinbase = coinbase if atomic.LoadInt32(&self.canStart) == 0 { @@ -177,7 +177,7 @@ func (self *Miner) PendingBlock() *types.Block { return self.worker.pendingBlock() } -func (self *Miner) SetEtherbase(addr common.Address) { +func (self *Miner) SetCoinbase(addr common.Address) { self.coinbase = addr - self.worker.setEtherbase(addr) + self.worker.setCoinbase(addr) } diff --git a/miner/worker.go b/miner/worker.go index c1f848e327..d0c825cf94 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -158,7 +158,7 @@ func newWorker(config *params.ChainConfig, engine consensus.Engine, coinbase com return worker } -func (self *worker) setEtherbase(addr common.Address) { +func (self *worker) setCoinbase(addr common.Address) { self.mu.Lock() defer self.mu.Unlock() self.coinbase = addr