From: Matt Joiner Date: Tue, 2 Aug 2016 01:18:33 +0000 (+1000) Subject: Fix some more races in the status writing X-Git-Tag: v1.0.0~617 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=6065a55818c30dfbe7c3cfd4505b7532d2ae4a6a;p=btrtrc.git Fix some more races in the status writing --- diff --git a/torrent.go b/torrent.go index dd3a83cf..ff8f772f 100644 --- a/torrent.go +++ b/torrent.go @@ -424,10 +424,10 @@ func (t *Torrent) writeStatus(w io.Writer) { return "?" } }()) - if t.haveInfo() { + if t.Info() != nil { fmt.Fprintf(w, "Num Pieces: %d\n", t.numPieces()) fmt.Fprint(w, "Piece States:") - for _, psr := range t.pieceStateRuns() { + for _, psr := range t.PieceStateRuns() { w.Write([]byte(" ")) w.Write([]byte(pieceStateRunStatusChars(psr))) }