aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/eth.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-07-05 01:03:37 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-07-05 01:03:37 +0800
commit30afd37604da40416b0dd4fdc8cad322c12651cf (patch)
treebc9929c4b0bf29dc29bf9f022af0d3acc7800c1d /rpc/api/eth.go
parentcd4cc309ae4ead756cbe58ad564b029e874d9832 (diff)
downloaddexon-30afd37604da40416b0dd4fdc8cad322c12651cf.tar
dexon-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.gz
dexon-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.bz2
dexon-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.lz
dexon-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.xz
dexon-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.zst
dexon-30afd37604da40416b0dd4fdc8cad322c12651cf.zip
Compose additional fields
Diffstat (limited to 'rpc/api/eth.go')
-rw-r--r--rpc/api/eth.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/rpc/api/eth.go b/rpc/api/eth.go
index 0f3b14525..6d759a087 100644
--- a/rpc/api/eth.go
+++ b/rpc/api/eth.go
@@ -605,13 +605,18 @@ func (self *ethApi) GetTransactionReceipt(req *shared.Request) (interface{}, err
}
txhash := common.BytesToHash(common.FromHex(args.Hash))
+ tx, bhash, bnum, txi := self.xeth.EthTransactionByHash(args.Hash)
rec := self.xeth.GetTxReceipt(txhash)
// We could have an error of "not found". Should disambiguate
// if err != nil {
// return err, nil
// }
- if rec != nil {
+ if rec != nil && tx != nil {
v := NewReceiptRes(rec)
+ v.BlockHash = newHexData(bhash)
+ v.BlockNumber = newHexNum(bnum)
+ v.GasUsed = newHexNum(tx.Gas().Bytes())
+ v.TransactionIndex = newHexNum(txi)
return v, nil
}