@@ -50,7 +50,7 @@ Swarm.prototype.scrape = function (params, cb) {
5050Swarm . 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) {
7979Swarm . 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) {
9595Swarm . 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