Store and retrieve tx context metadata #608

Improving this in the future will allow for cleaning up a bit of legacy
code.
This commit is contained in:
Taylor Gerring
2015-03-31 22:40:12 +02:00
parent 7e3875b527
commit 40ea466200
3 changed files with 51 additions and 8 deletions

View File

@ -199,9 +199,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
args := new(HashIndexArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
}
tx := api.xeth().EthTransactionByHash(args.Hash)
tx, bhash, bnum, txi := api.xeth().EthTransactionByHash(args.Hash)
if tx != nil {
*reply = NewTransactionRes(tx)
v := NewTransactionRes(tx)
v.BlockHash = newHexData(bhash)
v.BlockNumber = newHexNum(bnum)
v.TxIndex = newHexNum(txi)
*reply = v
}
case "eth_getTransactionByBlockHashAndIndex":
args := new(HashIndexArgs)