Use common.Address type for accounts.Address
This commit is contained in:
@ -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{}) {
|
||||
err = fmt.Errorf("no accounts found")
|
||||
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() }
|
||||
|
Reference in New Issue
Block a user