diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-04-03 03:14:25 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-05-12 23:19:39 +0800 |
commit | da9fe951da4005761a014316c46771d628dc058e (patch) | |
tree | d5344172ed915b4890d66c3cf3b4181e30589471 /eth | |
parent | 6b23094cff77d7e485e0a2ae5698884f63c87ce7 (diff) | |
download | dexon-da9fe951da4005761a014316c46771d628dc058e.tar.gz dexon-da9fe951da4005761a014316c46771d628dc058e.tar.zst dexon-da9fe951da4005761a014316c46771d628dc058e.zip |
Use common.Address type for accounts.Address
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/eth/backend.go b/eth/backend.go index 7960a0e61..65b096d49 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -386,14 +386,17 @@ func (s *Ethereum) StartMining(threads int) error { func (s *Ethereum) Etherbase() (eb common.Address, err error) { eb = s.etherbase if (eb == common.Address{}) { - var ebbytes []byte - ebbytes, err = s.accountManager.Primary() - eb = common.BytesToAddress(ebbytes) - if (eb == common.Address{}) { + primary, err := s.accountManager.Primary() + if err != nil { + return eb, err + } + if (primary == common.Address{}) { err = fmt.Errorf("no accounts found") + return eb, err } + eb = primary } - return + return eb, nil } func (s *Ethereum) StopMining() { s.miner.Stop() } |