Add client command for getrawtransaction, more indexing speed-up
This commit is contained in:
+16
-4
@@ -147,10 +147,22 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_rawtransaction: function(hash, cb) {
|
||||
var uri = base_url + 'getrawtransaction?txid=' + hash + '&decrypt=1';
|
||||
request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) {
|
||||
return cb(body);
|
||||
});
|
||||
if (settings.use_rpc) {
|
||||
var uri = base_url + 'getrawtransaction?txid=' + hash + '&decrypt=1';
|
||||
request({uri: uri, json: true}, function (error, response, body) {
|
||||
return cb(body);
|
||||
});
|
||||
} else {
|
||||
client.command([{method:'getrawtransaction', parameters: [hash, 1]}], function(err, response){
|
||||
if(err){console.log('Error: ', err); onlyConsole.trace(err)}
|
||||
else{
|
||||
if(response[0].name == 'RpcError'){
|
||||
return cb('There was an error. Check your console.');
|
||||
}
|
||||
return cb(response[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
get_maxmoney: function(cb) {
|
||||
|
||||
Reference in New Issue
Block a user