diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-04-01 04:40:12 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-04-01 04:40:12 +0800 |
commit | 40ea46620066bd7888b3f9a425fcd6201e0c7320 (patch) | |
tree | 298a8041dfc26c837c57410ff5b175a656e31217 /rpc | |
parent | 7e3875b52720bf7456c9dd6162caeb7250d3686e (diff) | |
download | dexon-40ea46620066bd7888b3f9a425fcd6201e0c7320.tar.gz dexon-40ea46620066bd7888b3f9a425fcd6201e0c7320.tar.zst dexon-40ea46620066bd7888b3f9a425fcd6201e0c7320.zip |
Store and retrieve tx context metadata #608
Improving this in the future will allow for cleaning up a bit of legacy
code.
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/api.go | 8 |
1 files changed, 6 insertions, 2 deletions
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) |