diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-04-12 22:51:09 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-04-12 22:51:09 +0800 |
commit | 1e9b504ee7c7ebfd4b2658c66fad53fe6d440811 (patch) | |
tree | 66d229bcfb3381fe0964faf573fc6cf6b0073c75 /common/registrar/ethreg/api.go | |
parent | 33e4f51749cdfcb9125159aae8481a8130e50062 (diff) | |
parent | 6498df7b0290139df57629568d824dfa242900cc (diff) | |
download | go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.gz go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.bz2 go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.lz go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.xz go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.zst go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.zip |
Merge pull request #2284 from fjl/accounts-addr-cache
accounts: cache key addresses
Diffstat (limited to 'common/registrar/ethreg/api.go')
-rw-r--r-- | common/registrar/ethreg/api.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/registrar/ethreg/api.go b/common/registrar/ethreg/api.go index d035616f2..6d77a9385 100644 --- a/common/registrar/ethreg/api.go +++ b/common/registrar/ethreg/api.go @@ -158,8 +158,8 @@ func (be *registryAPIBackend) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr var from *state.StateObject if len(fromStr) == 0 { - accounts, err := be.am.Accounts() - if err != nil || len(accounts) == 0 { + accounts := be.am.Accounts() + if len(accounts) == 0 { from = statedb.GetOrNewStateObject(common.Address{}) } else { from = statedb.GetOrNewStateObject(accounts[0].Address) @@ -254,8 +254,7 @@ func (be *registryAPIBackend) Transact(fromStr, toStr, nonceStr, valueStr, gasSt tx = types.NewTransaction(nonce, to, value, gas, price, data) } - acc := accounts.Account{from} - signature, err := be.am.Sign(acc, tx.SigHash().Bytes()) + signature, err := be.am.Sign(from, tx.SigHash().Bytes()) if err != nil { return "", err } |