From e87521149a517bf54619cf76f248a99003f20cd4 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 26 Oct 2017 16:59:50 -0300 Subject: [PATCH 1/2] new timeouts --- lib/blockchainexplorers/insight.js | 1 + lib/common/defaults.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/blockchainexplorers/insight.js b/lib/blockchainexplorers/insight.js index 937eb83..614c68b 100644 --- a/lib/blockchainexplorers/insight.js +++ b/lib/blockchainexplorers/insight.js @@ -59,6 +59,7 @@ Insight.prototype.getUtxos = function(addresses, cb) { json: { addrs: _.uniq([].concat(addresses)).join(',') }, + timeout: 120000, }; this._doRequest(args, function(err, res, unspent) { diff --git a/lib/common/defaults.js b/lib/common/defaults.js index efce6e8..130237b 100644 --- a/lib/common/defaults.js +++ b/lib/common/defaults.js @@ -103,17 +103,17 @@ Defaults.SESSION_EXPIRATION = 1 * 60 * 60; // 1 hour to session expiration Defaults.RateLimit = { createWallet: { 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 - 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" }, estimateFee: { 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 - max: 20, // start blocking after 200 request + max: 10, // start blocking after 200 request message: "Too many request" }, From 46bee919daf560b86171ef3e30bb129f0a528d73 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 26 Oct 2017 17:37:58 -0300 Subject: [PATCH 2/2] fix deps --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 198b6b6..b6d937c 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ }, "dependencies": { "async": "^0.9.2", - "bitcore-lib": "^0.14.0", - "bitcore-lib-cash": "https://github.com/bitpay/bitcore-lib.git#cash", + "bitcore-lib": "=0.14.0", + "bitcore-lib-cash": "https://github.com/bitpay/bitcore-lib.git#243565eaa15ad2b855665ea38a94a5081adb29cc", "body-parser": "^1.11.0", "compression": "^1.6.2", "coveralls": "^2.11.2",