add trim options and timeout
This commit is contained in:
parent
8ba6048cb4
commit
32d9d0c921
|
@ -104,7 +104,10 @@ Insight.prototype.getTransactions = function(addresses, from, to, cb) {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: this.apiPrefix + '/addrs/txs' + (qs.length > 0 ? '?' + qs.join('&') : ''),
|
path: this.apiPrefix + '/addrs/txs' + (qs.length > 0 ? '?' + qs.join('&') : ''),
|
||||||
json: {
|
json: {
|
||||||
addrs: [].concat(addresses).join(',')
|
addrs: [].concat(addresses).join(','),
|
||||||
|
noAsm: 1,
|
||||||
|
noScriptSig: 1,
|
||||||
|
noSpent: 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@ var $ = require('preconditions').singleton();
|
||||||
var log = require('npmlog');
|
var log = require('npmlog');
|
||||||
log.debug = log.verbose;
|
log.debug = log.verbose;
|
||||||
|
|
||||||
|
|
||||||
|
var DEFAULT_TIMEOUT= 50000; // 50 s
|
||||||
/**
|
/**
|
||||||
* Query a server, using one of the given options
|
* Query a server, using one of the given options
|
||||||
*
|
*
|
||||||
|
@ -19,6 +21,8 @@ var requestList = function(args, cb) {
|
||||||
if (!_.isArray(args.hosts))
|
if (!_.isArray(args.hosts))
|
||||||
args.hosts = [args.hosts];
|
args.hosts = [args.hosts];
|
||||||
|
|
||||||
|
args.timeout = args.timeout || DEFAULT_TIMEOUT;
|
||||||
|
|
||||||
var urls = _.map(args.hosts, function(x) {
|
var urls = _.map(args.hosts, function(x) {
|
||||||
return (x + args.path);
|
return (x + args.path);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue