rpc: fix getrawtransaction.

This commit is contained in:
Christopher Jeffrey 2016-08-17 06:05:39 -07:00
parent 581a658808
commit 3841eb3e58
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

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