Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-07-27 06:27:03 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-07-27 06:27:03 +0300
commitdd623c5da98dbb73a9e583acfeac424352738da6 (patch)
treeb3087e3d2f486cf8f5c8e143fdd8ae1b35adcace /index.js
parent759db8b481c569fda9f4ebd74c2a0b037164114c (diff)
Skip blocklist logic when opts.blocklist is not set
Fixes #862
Diffstat (limited to 'index.js')
-rw-r--r--index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/index.js b/index.js
index 8ed828a..70a2818 100644
--- a/index.js
+++ b/index.js
@@ -134,7 +134,7 @@ function WebTorrent (opts) {
debug('new webtorrent (peerId %s, nodeId %s)', self.peerId, self.nodeId)
- if (typeof loadIPSet === 'function') {
+ if (typeof loadIPSet === 'function' && opts.blocklist != null) {
loadIPSet(opts.blocklist, {
headers: {
'user-agent': 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
@@ -144,7 +144,9 @@ function WebTorrent (opts) {
self.blocked = ipSet
ready()
})
- } else process.nextTick(ready)
+ } else {
+ process.nextTick(ready)
+ }
function ready () {
if (self.destroyed) return