From 0d545939d89acb2b3b77df30826985ccbef31422 Mon Sep 17 00:00:00 2001 From: noot <36753753+noot@users.noreply.github.com> Date: Mon, 21 Sep 2020 11:59:07 -0400 Subject: [PATCH] fix doCall if args.From is nil (#518) --- rpc/eth_api.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rpc/eth_api.go b/rpc/eth_api.go index f0c10989..b21783da 100644 --- a/rpc/eth_api.go +++ b/rpc/eth_api.go @@ -517,11 +517,10 @@ func (e *PublicEthAPI) doCall( var addr common.Address if args.From == nil { - key, exist := checkKeyInKeyring(e.keys, *args.From) - if exist { - addr = common.BytesToAddress(key.PubKey().Address().Bytes()) + addrs, err := e.Accounts() + if err == nil && len(addrs) > 0 { + addr = addrs[0] } - // No error handled here intentionally to match geth behaviour } else { addr = *args.From }