Remove bad half open count assertion

This commit is contained in:
Matt Joiner 2023-05-02 17:10:02 +10:00
parent 884b71ea6d
commit ba0b955f72
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
1 changed files with 2 additions and 3 deletions

View File

@ -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()