etherbase defaults to first account even if created during the session
This commit is contained in:
@ -488,7 +488,11 @@ func (s *Ethereum) StartMining(threads int) error {
|
||||
func (s *Ethereum) Etherbase() (eb common.Address, err error) {
|
||||
eb = s.etherbase
|
||||
if (eb == common.Address{}) {
|
||||
err = fmt.Errorf("etherbase address must be explicitly specified")
|
||||
addr, e := s.AccountManager().AddressByIndex(0)
|
||||
if e != nil {
|
||||
err = fmt.Errorf("etherbase address must be explicitly specified")
|
||||
}
|
||||
eb = common.HexToAddress(addr)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user