accounts, cmd, eth, internal, mobile, node: split account backends
This commit is contained in:
@ -361,15 +361,13 @@ func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) {
|
||||
}
|
||||
|
||||
func (s *Ethereum) Etherbase() (eb common.Address, err error) {
|
||||
eb = s.etherbase
|
||||
if (eb == common.Address{}) {
|
||||
firstAccount, err := s.AccountManager().AccountByIndex(0)
|
||||
eb = firstAccount.Address
|
||||
if err != nil {
|
||||
return eb, fmt.Errorf("etherbase address must be explicitly specified")
|
||||
}
|
||||
if s.etherbase != (common.Address{}) {
|
||||
return s.etherbase, nil
|
||||
}
|
||||
return eb, nil
|
||||
if accounts := s.AccountManager().Accounts(); len(accounts) > 0 {
|
||||
return accounts[0].Address, nil
|
||||
}
|
||||
return common.Address{}, fmt.Errorf("etherbase address must be explicitly specified")
|
||||
}
|
||||
|
||||
// set in js console via admin interface or wrapper from cli flags
|
||||
|
Reference in New Issue
Block a user