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); }); };