Merge pull request #197 from feross/fewer-offers

ws client: Don't include offers with 'completed' event
This commit is contained in:
Feross Aboukhadijeh 2017-02-03 23:46:20 +01:00 committed by GitHub
commit 9d5b55b498

View File

@ -60,8 +60,8 @@ WebSocketTracker.prototype.announce = function (opts) {
})
if (self._trackerId) params.trackerid = self._trackerId
if (opts.event === 'stopped') {
// Don't include offers with 'stopped' event
if (opts.event === 'stopped' || opts.event === 'completed') {
// Don't include offers with 'stopped' or 'completed' event
self._send(params)
} else {
// Limit the number of offers that are generated, since it can be slow