aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-04-12 22:51:09 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-04-12 22:51:09 +0800
commit1e9b504ee7c7ebfd4b2658c66fad53fe6d440811 (patch)
tree66d229bcfb3381fe0964faf573fc6cf6b0073c75 /eth/backend.go
parent33e4f51749cdfcb9125159aae8481a8130e50062 (diff)
parent6498df7b0290139df57629568d824dfa242900cc (diff)
downloaddexon-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar
dexon-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.gz
dexon-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.bz2
dexon-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.lz
dexon-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.xz
dexon-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.zst
dexon-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.zip
Merge pull request #2284 from fjl/accounts-addr-cache
accounts: cache key addresses
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 cab83588c..ea12e4215 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -363,13 +363,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