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) {
|
RPC.prototype.getrawtransaction = function getrawtransaction(args, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var hash, verbose;
|
var hash, verbose, json;
|
||||||
|
|
||||||
if (args.help || args.length < 1 || args.length > 2)
|
if (args.help || args.length < 1 || args.length > 2)
|
||||||
return callback(new RPCError('getrawtransaction "txid" ( verbose )'));
|
return callback(new RPCError('getrawtransaction "txid" ( verbose )'));
|
||||||
@ -1962,10 +1962,10 @@ RPC.prototype.getrawtransaction = function getrawtransaction(args, callback) {
|
|||||||
if (!verbose)
|
if (!verbose)
|
||||||
return callback(null, tx.toRaw().toString('hex'));
|
return callback(null, tx.toRaw().toString('hex'));
|
||||||
|
|
||||||
tx = self.txToJSON(tx);
|
json = self.txToJSON(tx);
|
||||||
tx.hex = tx.toRaw().toString('hex');
|
json.hex = tx.toRaw().toString('hex');
|
||||||
|
|
||||||
callback(null, tx);
|
callback(null, json);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user