Skip to content

Commit

Permalink
Remove bad half open count assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed May 9, 2023
1 parent 884b71e commit ba0b955
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ba0b955

Please sign in to comment.