aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/eth/backend.go b/eth/backend.go
index f4282d59f..12ce30767 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -359,13 +359,13 @@ func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) {
func (s *Ethereum) Etherbase() (eb common.Address, err error) {
eb = s.etherbase
if (eb == common.Address{}) {
- addr, e := s.AccountManager().AddressByIndex(0)
- if e != nil {
- err = fmt.Errorf("etherbase address must be explicitly specified")
+ firstAccount, err := s.AccountManager().AccountByIndex(0)
+ eb = firstAccount.Address
+ if err != nil {
+ return eb, fmt.Errorf("etherbase address must be explicitly specified")
}
- eb = common.HexToAddress(addr)
}
- return
+ return eb, nil
}
// set in js console via admin interface or wrapper from cli flags