Browse Source

new timeouts

bug/timeouts
Matias Alejo Garcia 7 years ago
parent
commit
e87521149a
No known key found for this signature in database GPG Key ID: 2470DB551277AB3
  1. 1
      lib/blockchainexplorers/insight.js
  2. 8
      lib/common/defaults.js

1
lib/blockchainexplorers/insight.js

@ -59,6 +59,7 @@ Insight.prototype.getUtxos = function(addresses, cb) {
json: { json: {
addrs: _.uniq([].concat(addresses)).join(',') addrs: _.uniq([].concat(addresses)).join(',')
}, },
timeout: 120000,
}; };
this._doRequest(args, function(err, res, unspent) { this._doRequest(args, function(err, res, unspent) {

8
lib/common/defaults.js

@ -103,17 +103,17 @@ Defaults.SESSION_EXPIRATION = 1 * 60 * 60; // 1 hour to session expiration
Defaults.RateLimit = { Defaults.RateLimit = {
createWallet: { createWallet: {
windowMs: 60 * 60 * 1000, // hour window windowMs: 60 * 60 * 1000, // hour window
delayAfter: 10, // begin slowing down responses after the 3rd request delayAfter: 8, // begin slowing down responses after the 3rd request
delayMs: 3000, // slow down subsequent responses by 3 seconds per request delayMs: 3000, // slow down subsequent responses by 3 seconds per request
max: 20, // start blocking after 20 request max: 15, // start blocking after 20 request
message: "Too many wallets created from this IP, please try again after an hour" message: "Too many wallets created from this IP, please try again after an hour"
}, },
estimateFee: { estimateFee: {
windowMs: 60 * 10 *1000, // 10 min window windowMs: 60 * 10 *1000, // 10 min window
delayAfter: 10, // begin slowing down responses after the 3rd request delayAfter: 5, // begin slowing down responses after the 3rd request
delayMs: 300, // slow down subsequent responses by 3 seconds per request delayMs: 300, // slow down subsequent responses by 3 seconds per request
max: 20, // start blocking after 200 request max: 10, // start blocking after 200 request
message: "Too many request" message: "Too many request"
}, },

Loading…
Cancel
Save