diff options
author | Felix Lange <fjl@twurst.com> | 2016-03-03 08:09:16 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-04-12 21:58:01 +0800 |
commit | 46e8940b19fee9bc21767a1341c382fd9c9d572a (patch) | |
tree | 384b700810910857cd40e099aba0d5a525eec066 /eth/backend.go | |
parent | 2dc20963e789c85bcc9170e15c0483e51ca42bfc (diff) | |
download | go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.gz go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.bz2 go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.lz go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.xz go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.zst go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.zip |
accounts: streamline API
- Manager.Accounts no longer returns an error.
- Manager methods take Account instead of common.Address.
- All uses of Account with unkeyed fields are converted.
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/eth/backend.go b/eth/backend.go index f4282d59f..12ce30767 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -359,13 +359,13 @@ func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) { func (s *Ethereum) Etherbase() (eb common.Address, err error) { eb = s.etherbase if (eb == common.Address{}) { - addr, e := s.AccountManager().AddressByIndex(0) - if e != nil { - err = fmt.Errorf("etherbase address must be explicitly specified") + firstAccount, err := s.AccountManager().AccountByIndex(0) + eb = firstAccount.Address + if err != nil { + return eb, fmt.Errorf("etherbase address must be explicitly specified") } - eb = common.HexToAddress(addr) } - return + return eb, nil } // set in js console via admin interface or wrapper from cli flags |