diff options
author | zelig <viktor.tron@gmail.com> | 2015-07-27 16:50:29 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-07-27 16:50:29 +0800 |
commit | 1356daad276b849a192c84834d78a6cf32d739eb (patch) | |
tree | ccb95f6de7633c83016a90a6e87873f00d2b5b56 /eth | |
parent | d18d256442e2dc3413ebd9f571e1a5f6be366c09 (diff) | |
download | dexon-1356daad276b849a192c84834d78a6cf32d739eb.tar.gz dexon-1356daad276b849a192c84834d78a6cf32d739eb.tar.zst dexon-1356daad276b849a192c84834d78a6cf32d739eb.zip |
etherbase defaults to first account even if created during the session
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go index cba1b3939..4b8c4858f 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 } |