cmd/utils, eth: init etherbase from within eth (#15528)
This commit is contained in:
committed by
Felix Lange
parent
bf62acf033
commit
46e5583993
@ -310,10 +310,17 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
|
||||
}
|
||||
if wallets := s.AccountManager().Wallets(); len(wallets) > 0 {
|
||||
if accounts := wallets[0].Accounts(); len(accounts) > 0 {
|
||||
return accounts[0].Address, nil
|
||||
etherbase := accounts[0].Address
|
||||
|
||||
s.lock.Lock()
|
||||
s.etherbase = etherbase
|
||||
s.lock.Unlock()
|
||||
|
||||
log.Info("Etherbase automatically configured", "address", etherbase)
|
||||
return etherbase, nil
|
||||
}
|
||||
}
|
||||
return common.Address{}, fmt.Errorf("etherbase address must be explicitly specified")
|
||||
return common.Address{}, fmt.Errorf("etherbase must be explicitly specified")
|
||||
}
|
||||
|
||||
// set in js console via admin interface or wrapper from cli flags
|
||||
|
Reference in New Issue
Block a user