t.go | 2 ++ diff --git a/t.go b/t.go index f517ab680533f5df774e59a1cde00123daea7bab..a808cbf47d29d505cf1f8eb0eab0abdf0b6a46a6 100644 --- a/t.go +++ b/t.go @@ -254,6 +254,8 @@ return t.piece(i) } func (t *Torrent) PeerConns() []*PeerConn { + t.cl.rLock() + defer t.cl.rUnlock() ret := make([]*PeerConn, 0, len(t.conns)) for c := range t.conns { ret = append(ret, c)