diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-05-16 05:34:39 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-05-16 05:34:39 +0300 |
commit | de8b5ea260504cb6f5b45c8dabd68ccf8a0c4d70 (patch) | |
tree | 4aeced01bfc7510429fada814125607d6fad16a2 /lib | |
parent | f559337a461bb949a0190948ab288f12743ab6ed (diff) |
dedupe parsedTorrent.announce
have to do this after adding new tracker to the array
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 8dd33d4..6a72736 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -12,6 +12,7 @@ var parallel = require('run-parallel') var parseTorrent = require('parse-torrent') var reemit = require('re-emitter') var Swarm = require('bittorrent-swarm') // `webtorrent-swarm` in browser +var uniq = require('uniq') var ut_metadata = require('ut_metadata') var ut_pex = require('ut_pex') // browser exclude @@ -130,6 +131,7 @@ function Torrent (torrentId, opts) { global.WEBTORRENT_ANNOUNCE.forEach(function (url) { self.parsedTorrent.announce.push(url) }) + uniq(self.parsedTorrent.announce) } // create swarm |