From da9fe951da4005761a014316c46771d628dc058e Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Thu, 2 Apr 2015 21:14:25 +0200 Subject: Use common.Address type for accounts.Address --- eth/backend.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'eth') 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() } -- cgit