From ffcd84f07bd161ac424e682a683b09d376eff331 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 4 Jan 2015 21:48:23 -0800 Subject: client.seed: skip piece verification for performance For https://github.com/feross/webtorrent/issues/235 --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'index.js') diff --git a/index.js b/index.js index 0d83b7b..f6d98a8 100644 --- a/index.js +++ b/index.js @@ -149,7 +149,8 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) { opts.client = self opts.storage = opts.storage || self.storage - if (opts.tmp) opts.storageOpts = { tmp: opts.tmp } + if (!opts.storageOpts) opts.storageOpts = {} + if (opts.tmp) opts.storageOpts.tmp = opts.tmp var torrent = new Torrent(torrentId, extend({ client: self }, opts)) self.torrents.push(torrent) @@ -192,6 +193,8 @@ WebTorrent.prototype.seed = function (input, opts, onseed) { opts = {} } if (!opts) opts = {} + if (!opts.storageOpts) opts.storageOpts = {} + opts.storageOpts.noVerify = true createTorrent.parseInput(input, opts, function (err, files) { if (err) return self.emit('error', err) -- cgit v1.2.3