From b80f6b65f205ab03d3a5286da0404c95d29eaa9f Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 9 Sep 2024 20:53:29 +1000 Subject: [PATCH] Fix panic using web RTC RemoteAddr directly from conn Fixes #972. --- torrent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torrent.go b/torrent.go index 8bd34dbcf9..4749c8a876 100644 --- a/torrent.go +++ b/torrent.go @@ -2204,7 +2204,7 @@ func (t *Torrent) statsLocked() (ret TorrentStats) { func (t *Torrent) numTotalPeers() int { peers := make(map[string]struct{}) for conn := range t.conns { - ra := conn.conn.RemoteAddr() + ra := conn.RemoteAddr if ra == nil { // It's been closed and doesn't support RemoteAddr. continue