diff options
author | kumavis <aaron@kumavis.me> | 2017-08-08 01:52:08 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2017-08-08 01:52:08 +0800 |
commit | 78aa957e5ab5bd3e7f7fb4628c82de8ae312750f (patch) | |
tree | ffe2ece4164b9d6c70196dd3ab608244bdf95281 /app/scripts | |
parent | 82ba2c95ee98487dd465e5aabd45f18d46e89727 (diff) | |
parent | 57abc58d623b66a091987a944d8c45737f4feabe (diff) | |
download | tangerine-wallet-browser-78aa957e5ab5bd3e7f7fb4628c82de8ae312750f.tar.gz tangerine-wallet-browser-78aa957e5ab5bd3e7f7fb4628c82de8ae312750f.tar.zst tangerine-wallet-browser-78aa957e5ab5bd3e7f7fb4628c82de8ae312750f.zip |
Merge branch 'master' of github.com:MetaMask/metamask-extension into greenkeeper/initial
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/controllers/blacklist.js | 5 | ||||
-rw-r--r-- | app/scripts/lib/nodeify.js | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/scripts/controllers/blacklist.js b/app/scripts/controllers/blacklist.js index 7e01fa386..dd671943f 100644 --- a/app/scripts/controllers/blacklist.js +++ b/app/scripts/controllers/blacklist.js @@ -4,8 +4,8 @@ const PhishingDetector = require('eth-phishing-detect/src/detector') // compute phishing lists const PHISHING_DETECTION_CONFIG = require('eth-phishing-detect/src/config.json') -// every ten minutes -const POLLING_INTERVAL = 10 * 60 * 1000 +// every four minutes +const POLLING_INTERVAL = 4 * 60 * 1000 class BlacklistController { @@ -41,6 +41,7 @@ class BlacklistController { scheduleUpdates () { if (this._phishingUpdateIntervalRef) return + this.updatePhishingList() this._phishingUpdateIntervalRef = setInterval(() => { this.updatePhishingList() }, POLLING_INTERVAL) diff --git a/app/scripts/lib/nodeify.js b/app/scripts/lib/nodeify.js index 299bfe624..832d6c6d3 100644 --- a/app/scripts/lib/nodeify.js +++ b/app/scripts/lib/nodeify.js @@ -1,9 +1,10 @@ const promiseToCallback = require('promise-to-callback') -module.exports = function(fn, context) { +module.exports = function nodeify (fn, context) { return function(){ const args = [].slice.call(arguments) const callback = args.pop() + if (typeof callback !== 'function') throw new Error('callback is not a function') promiseToCallback(fn.apply(context, args))(callback) } } |