6

On testnet I am analyzing the following transaction https://testnet.etherscan.io/tx/0x7b111a37998b25116b1a6962d393253bf09613dd083b420ec24ffc9a28bc74b6 having this attributes:

Gas: 90000 and Gas Used By Transaction: 21000

I guess 21000 is the actual fee applied to this tx, but what is Gas: 90000 then?

I am a bit confused because when querying this tx through json-rpc on my geth node using eth_getTransactionByHash method I got this result:

gas => 0x15f90 = 90000

but there is no field gasUsed or similar. So it seems there is no way to find out actual tx fee, right?

How can I get gasUsed value for a tx using json-rpc calls?

2 Answers 2

6

The gas value is sent by the external account that created the transaction. With the transaction object { from: account: gas: 90000, ... }. When you call eth.getTransaction("0x..") you get the same value.

The gasUsed can be retrieved with eth.getTransactionReceipt("0x..").

1
1

Gas: 900000 is the amount of gas you estimate the transaction will consume

Gas Used: 21000 is the actual gas consumed by the transaction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.