forked from cerc-io/laconicd-deprecated
fix doCall if args.From is nil (#518)
This commit is contained in:
parent
fe99e7e493
commit
0d545939d8
@ -517,11 +517,10 @@ func (e *PublicEthAPI) doCall(
|
|||||||
var addr common.Address
|
var addr common.Address
|
||||||
|
|
||||||
if args.From == nil {
|
if args.From == nil {
|
||||||
key, exist := checkKeyInKeyring(e.keys, *args.From)
|
addrs, err := e.Accounts()
|
||||||
if exist {
|
if err == nil && len(addrs) > 0 {
|
||||||
addr = common.BytesToAddress(key.PubKey().Address().Bytes())
|
addr = addrs[0]
|
||||||
}
|
}
|
||||||
// No error handled here intentionally to match geth behaviour
|
|
||||||
} else {
|
} else {
|
||||||
addr = *args.From
|
addr = *args.From
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user