Add client command for getrawtransaction, more indexing speed-up

This commit is contained in:
joeuhren
2020-11-20 18:56:25 -07:00
parent 9df813ab77
commit 01d85628bd
2 changed files with 52 additions and 64 deletions
+16 -4
View File
@@ -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) {