From 3841eb3e58edba36ab9d946088b2c20585a28af5 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 17 Aug 2016 06:05:39 -0700 Subject: [PATCH] rpc: fix getrawtransaction. --- lib/bcoin/http/rpc.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bcoin/http/rpc.js b/lib/bcoin/http/rpc.js index e7a5a0a1..a23a3073 100644 --- a/lib/bcoin/http/rpc.js +++ b/lib/bcoin/http/rpc.js @@ -1937,7 +1937,7 @@ RPC.prototype.decodescript = function decodescript(args, callback) { RPC.prototype.getrawtransaction = function getrawtransaction(args, callback) { var self = this; - var hash, verbose; + var hash, verbose, json; if (args.help || args.length < 1 || args.length > 2) return callback(new RPCError('getrawtransaction "txid" ( verbose )')); @@ -1962,10 +1962,10 @@ RPC.prototype.getrawtransaction = function getrawtransaction(args, callback) { if (!verbose) return callback(null, tx.toRaw().toString('hex')); - tx = self.txToJSON(tx); - tx.hex = tx.toRaw().toString('hex'); + json = self.txToJSON(tx); + json.hex = tx.toRaw().toString('hex'); - callback(null, tx); + callback(null, json); }); };