Fix panic in update requests timer func on closed conn

This commit is contained in:
Matt Joiner 2021-10-25 16:16:06 +11:00
parent e178f99f35
commit 506996d038
1 changed files with 3 additions and 0 deletions

View File

@ -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
}