diff options
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/eth/backend.go b/eth/backend.go index e7f0f57dd..c39974a2c 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -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 |