Compose additional fields

This commit is contained in:
Taylor Gerring
2015-07-04 12:03:37 -05:00
parent cd4cc309ae
commit 30afd37604
2 changed files with 18 additions and 5 deletions

View File

@ -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
}