File tree Expand file tree Collapse file tree 1 file changed +14
-19
lines changed
Expand file tree Collapse file tree 1 file changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -659,32 +659,27 @@ Server.prototype._onAnnounce = function (params, cb) {
659659
660660 self . getSwarm ( params . info_hash , function ( err , swarm ) {
661661 if ( err ) return cb ( err )
662- if ( swarm ) {
663- announce ( swarm )
664- } else {
665- createSwarm ( )
666- }
667- } )
668662
669- function createSwarm ( ) {
670663 if ( self . _filter ) {
671664 self . _filter ( params . info_hash , params , function ( err ) {
672- // Precense of err means that this info_hash is disallowed
673- if ( err ) {
674- cb ( err )
675- } else {
676- self . createSwarm ( params . info_hash , function ( err , swarm ) {
677- if ( err ) return cb ( err )
678- announce ( swarm )
679- } )
665+ // Precense of err means that this torrent or user is disallowd
666+ if ( err ) cb ( err )
667+ else {
668+ if ( swarm ) announce ( swarm )
669+ else createSwarm ( )
680670 }
681671 } )
682672 } else {
683- self . createSwarm ( params . info_hash , function ( err , swarm ) {
684- if ( err ) return cb ( err )
685- announce ( swarm )
686- } )
673+ if ( swarm ) announce ( swarm )
674+ else createSwarm ( )
687675 }
676+ } )
677+
678+ function createSwarm ( ) {
679+ self . createSwarm ( params . info_hash , function ( err , swarm ) {
680+ if ( err ) return cb ( err )
681+ announce ( swarm )
682+ } )
688683 }
689684
690685 function announce ( swarm ) {
You can’t perform that action at this time.
0 commit comments