aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-07-28 20:11:43 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-07-28 20:11:43 +0800
commita281df783d32270c188d05872b8008eb0b74d042 (patch)
tree6548da21b4c784cde127d3451842e46b1a2d4017 /eth
parent1fad8798ec043b9b829caea96dd7a2c5e7b1ed36 (diff)
parent1356daad276b849a192c84834d78a6cf32d739eb (diff)
downloaddexon-a281df783d32270c188d05872b8008eb0b74d042.tar.gz
dexon-a281df783d32270c188d05872b8008eb0b74d042.tar.zst
dexon-a281df783d32270c188d05872b8008eb0b74d042.zip
Merge pull request #1533 from ethersphere/frontier/etherbase
Etherbase defaults to first account even if it is created during the session
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go
index dc592e7fc..bed6231ed 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -489,7 +489,11 @@ func (s *Ethereum) StartMining(threads int) error {
func (s *Ethereum) Etherbase() (eb common.Address, err error) {
eb = s.etherbase
if (eb == common.Address{}) {
- err = fmt.Errorf("etherbase address must be explicitly specified")
+ addr, e := s.AccountManager().AddressByIndex(0)
+ if e != nil {
+ err = fmt.Errorf("etherbase address must be explicitly specified")
+ }
+ eb = common.HexToAddress(addr)
}
return
}