From 40ea46620066bd7888b3f9a425fcd6201e0c7320 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Tue, 31 Mar 2015 22:40:12 +0200 Subject: Store and retrieve tx context metadata #608 Improving this in the future will allow for cleaning up a bit of legacy code. --- rpc/api.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'rpc') diff --git a/rpc/api.go b/rpc/api.go index 3f5d33da6..48039511e 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -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) -- cgit