Fix some more races in the status writing

This commit is contained in:
Matt Joiner 2016-08-02 11:18:33 +10:00
parent 39cf5a7fde
commit 6065a55818
1 changed files with 2 additions and 2 deletions

View File

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