Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTransactionByHash logs EOF error in terminal #962

Closed
frozeman opened this issue May 13, 2015 · 3 comments
Closed

getTransactionByHash logs EOF error in terminal #962

frozeman opened this issue May 13, 2015 · 3 comments
Labels

Comments

@frozeman
Copy link
Contributor

Sending the following for a non existing transaction:

{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x10522fd0474ee880359db0162d13ca7f57b0d7c8f32c0059ca14fc359fd34286"],"id":855}

Logs the following in the console:

I0513 18:28:32.306191   90997 xeth.go:329] EOF
@frozeman frozeman added the RPC label May 13, 2015
@tgerring
Copy link
Contributor

Result shows as null. What's the result from C++ ?

$ curl -v -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x10522fd0474ee880359db0162d13ca7f5b0d7c8f32c0059ca14fc359fd34286"],"id":855}' http://127.0.0.1:8545
* Rebuilt URL to: http://127.0.0.1:8545/
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8545 (#0)
> POST / HTTP/1.1
> User-Agent: curl/7.37.1
> Host: 127.0.0.1:8545
> Accept: */*
> Content-Length: 142
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 142 out of 142 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Wed, 13 May 2015 22:40:48 GMT
< Content-Length: 50
< 
{
    "id": 855,
    "jsonrpc": "2.0",
    "result": null
* Connection #0 to host 127.0.0.1 left intact
}

@tgerring
Copy link
Contributor

Looks like this might occur when the RLP decoder fails, perhaps when the object is not found in the database?

go-ethereum/xeth/xeth.go

Lines 321 to 330 in 2c1b0ff

v, _ := self.backend.ExtraDb().Get(append(common.FromHex(hash), 0x0001))
r := bytes.NewReader(v)
err := rlp.Decode(r, &txExtra)
if err == nil {
blhash = txExtra.BlockHash
blnum = big.NewInt(int64(txExtra.BlockIndex))
txi = txExtra.Index
} else {
glog.V(logger.Error).Infoln(err)
}

@tgerring
Copy link
Contributor

Fixed in 12f82ab

tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants