From 506996d038509f7b7df6e6baa51f0756a0707f5d Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 25 Oct 2021 16:16:06 +1100 Subject: [PATCH] Fix panic in update requests timer func on closed conn --- client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.go b/client.go index 142213c0..b4d3f17a 100644 --- a/client.go +++ b/client.go @@ -980,6 +980,9 @@ func (p *Peer) initUpdateRequestsTimer() { func (c *Peer) updateRequestsTimerFunc() { c.locker().Lock() defer c.locker().Unlock() + if c.closed.IsSet() { + return + } if c.needRequestUpdate != "" { return }