Skip to content

Commit 8f2e217

Browse files
authored
Merge pull request webtorrent#169 from alxhotel/master
Add id parameter in announce calls
2 parents cb35e58 + f14d0b8 commit 8f2e217

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/server/swarm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Swarm.prototype.scrape = function (params, cb) {
5050
Swarm.prototype._onAnnounceStarted = function (params, peer, id) {
5151
if (peer) {
5252
debug('unexpected `started` event from peer that is already in swarm')
53-
return this._onAnnounceUpdate(params, peer) // treat as an update
53+
return this._onAnnounceUpdate(params, peer, id) // treat as an update
5454
}
5555

5656
if (params.left === 0) this.complete += 1
@@ -79,7 +79,7 @@ Swarm.prototype._onAnnounceStopped = function (params, peer, id) {
7979
Swarm.prototype._onAnnounceCompleted = function (params, peer, id) {
8080
if (!peer) {
8181
debug('unexpected `completed` event from peer that is not in swarm')
82-
return this._onAnnounceStarted(params, peer) // treat as a start
82+
return this._onAnnounceStarted(params, peer, id) // treat as a start
8383
}
8484
if (peer.complete) {
8585
debug('unexpected `completed` event from peer that is already marked as completed')
@@ -95,7 +95,7 @@ Swarm.prototype._onAnnounceCompleted = function (params, peer, id) {
9595
Swarm.prototype._onAnnounceUpdate = function (params, peer, id) {
9696
if (!peer) {
9797
debug('unexpected `update` event from peer that is not in swarm')
98-
return this._onAnnounceStarted(params, peer) // treat as a start
98+
return this._onAnnounceStarted(params, peer, id) // treat as a start
9999
}
100100

101101
if (!peer.complete && params.left === 0) {

0 commit comments

Comments
 (0)