From: Matt Joiner Date: Tue, 2 May 2023 07:10:02 +0000 (+1000) Subject: Remove bad half open count assertion X-Git-Tag: v1.51.0~23 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ba0b955f72150a3d14a2cb1ac3bc07b4b33392b4;p=btrtrc.git Remove bad half open count assertion --- diff --git a/client.go b/client.go index 65545973..77f5587c 100644 --- a/client.go +++ b/client.go @@ -39,7 +39,6 @@ import ( "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/internal/check" "github.com/anacrolix/torrent/internal/limiter" - "github.com/anacrolix/torrent/internal/panicif" "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/mse" @@ -684,8 +683,8 @@ func (cl *Client) noLongerHalfOpen(t *Torrent, addr string, attemptKey outgoingC } path.Delete() cl.numHalfOpen-- - if check.Enabled { - panicif.NotEqual(cl.numHalfOpen, cl.countHalfOpenFromTorrents()) + if cl.numHalfOpen < 0 { + panic("should not be possible") } for _, t := range cl.torrents { t.openNewConns()