0

GETH VERSION

Geth

Version: 1.8.10-stable

Git Commit: eae63c511ceafab14b92e274c1b18bf1700e2d3d

Architecture: amd64

Protocol Versions: [63 62]

Network Id: 1

Go Version: go1.10.1

Operating System: linux

GOPATH=/home/myuser/go

GOROOT=/usr/lib/go-1.10

Node running under:

geth --testnet --rpc --rpcapi "eth,net,web3,personal,parity" --syncmode="light"

Problem 1:

When I tried to run out Node with --syncmode="full" or --syncmode="fast", CurrentBlock is always behind then HighestBlock, Approximately 64 blocks. So Node is running under --syncmode="light".

My Goal is to find all pending transactions on my accounts.

Steps to reproduce

  • eth.getBlock('pending').transactions

    ["0x2e6d5273fa29e892313166b8de458793fb0728f13a9077ab2295c1dc2371529c", "0xcc2e659ea3f8b6f6c1b812d559198427b0b2adf0316213c903e08c277384a1c6", "0x6a194f095f3b9ee65fa2eb9765617edda8ea99c2f8ad3e09d03d61735acd3a34", "0x604f53727f6ad056d82f57ce07b4e28cfae16c098dca909bffeaa51fb3584843"]
    
  • Curl eth_getTransactionByBlockHashAndIndex

        curl -X POST -H "Content-Type: application/json" --data'{"id":8,"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0xc0a9a6075081add64ac2f69b52f40de7b3d726281fc00a9ab23f90c892ae3346", "0x0"]}' http://localhost:8545
    

    It returns:

    { "jsonrpc":"2.0",

     "id":8,
     "result":
         {"blockHash":"0xc0a9a6075081add64ac2f69b52f40de7b3d726281fc00a9ab23f90c892ae3346",
    
        "blockNumber":"0x344c3b",
        "from":"0x40e0b46c7a461c02ab6e70d5536e23a9d727f9f8",
        "gas":"0x927c0",
    
        "gasPrice":"0x218711a00",
        "hash":"0x2e6d5273fa29e892313166b8de458793fb0728f13a9077ab2295c1dc2371529c",
    
        "input":"0xfe6362ae000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000c3332353136303935323130370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c3037363832333538353537300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d54755334664370664531563444784c547079507074596874664845446f5734774c745159675837375a376378000000000000000000000000000000000000",
    
        "nonce":"0x161",
        "to":"0xabe486e0ad5319d8047d5ef83e8c1cb1dce0d8c5",
        "transactionIndex":"0x0","value":"0x0","v":"0x2a",
        "r":"0xd1c106a22480e173784267c4da3db1707e2efd7598d9c55c6e060842d8e42390",
        "s":"0x15786e1f7f4bd53e402d4911b0334b38973609415868687f171501b64770331e"}}
    

it works perfect, Now lets ask for this transaction using getTransactionByHash

  • Now lets check eth_getTransactionByHash:

       curl -X POST -H "Content-Type: application/json" --data '{"id":8,"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x2e6d5273fa29e892313166b8de458793fb0728f13a9077ab2295c1dc2371529c"]}' http://localhost:8545
    

    It returns

    {"jsonrpc":"2.0","id":8,"result":null}
    

I have to get the same result, But i got null!

Any idea? Or any suggestion of another way how to get incoming pending transactions?

user9931607
  • 1
  • 1
  • 3

1 Answers1

0

You can always check for transaction details using getTransactionReceipt. Could you please try this and get back if you do get null sometimes?

Also regarding your question on getting pending transactions, mind you these pending transactions are not for your account or you node (if you haven't posted any). Since you are connected to the public version of Ethereum, you are getting these transactions which are some later point in time picked up by some miner and getting added to the ledger. For the answer, you might write a backend which saves the pending transaction data by polling it continuously and hence serve your purpose. I hope I have answered your question.

Subhasis
  • 1
  • 2