rpc: fix getrawtransaction.
This commit is contained in:
parent
581a658808
commit
3841eb3e58
@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user