From b6c1b3838bc447614e737eeac6ea9ca4198a05eb Mon Sep 17 00:00:00 2001 From: Justin Li Date: Sat, 21 Feb 2015 13:00:23 -0500 Subject: [PATCH] tracker: Remove impossible code for 'completed' event --- tracker/announce.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tracker/announce.go b/tracker/announce.go index 74a3bd9..725b591 100644 --- a/tracker/announce.go +++ b/tracker/announce.go @@ -230,20 +230,13 @@ func (tkr *Tracker) handlePeerEvent(ann *models.Announce, p *models.Peer) (snatc } case ann.Event == "completed": - v4seed := t.Seeders.Contains(p.Key()) - v6seed := t.Seeders.Contains(p.Key()) - if t.Leechers.Contains(p.Key()) { err = tkr.leecherFinished(t, p) } else { err = models.ErrBadRequest } - // If one of the dual-stacked peers is already a seeder, they have - // already snatched. - if !(v4seed || v6seed) { - snatched = true - } + snatched = true case t.Leechers.Contains(p.Key()) && ann.Left == 0: // A leecher completed but the event was never received.