good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 065e658f authored by Thomas Jay Rush's avatar Thomas Jay Rush Committed by GitHub
Browse files

Corrects incorrect return from eth_getCode for non-contract accounts (#1109)

parent a98469c6
No related branches found
No related tags found
No related merge requests found
......@@ -246,18 +246,12 @@ func (api *APIImpl) GetCode(ctx context.Context, address common.Address, blockNr
reader := adapter.NewStateReader(api.db, blockNumber)
acc, err := reader.ReadAccountData(address)
if err != nil {
return nil, err
}
if acc == nil {
return nil, fmt.Errorf("account %s not found", address)
if acc == nil || err != nil {
return hexutil.Bytes(""), nil
}
res, err := reader.ReadAccountCode(address, acc.CodeHash)
if err != nil {
return nil, err
if res == nil {
return hexutil.Bytes(""), nil
}
return res, nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment