]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Don't panic on request refresh if there are no existing requests
authorMatt Joiner <anacrolix@gmail.com>
Mon, 18 Oct 2021 10:50:13 +0000 (21:50 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 19 Oct 2021 03:08:56 +0000 (14:08 +1100)
client.go

index 179031d03e3a81b7b1bd21151a1769a05f9eb141..1efd98966182d4bbfe3f7a6504ad8790918c85fb 100644 (file)
--- a/client.go
+++ b/client.go
@@ -973,7 +973,8 @@ func (c *PeerConn) updateRequestsTimerFunc() {
                return
        }
        if c.actualRequestState.Requests.IsEmpty() {
-               panic("updateRequestsTimer should have been stopped")
+               // If there are no outstanding requests, then a request update should have already run.
+               return
        }
        c.updateRequests("updateRequestsTimer")
 }