]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix overpublishing of piece state change during hashing
authorMatt Joiner <anacrolix@gmail.com>
Sun, 7 Feb 2016 10:56:59 +0000 (21:56 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 7 Feb 2016 10:56:59 +0000 (21:56 +1100)
client.go

index 162767055fee7a6dc52ed1d14ea3058804cd6c8b..5429dd870d37892b783c097932f9e54ae7e27f28 100644 (file)
--- a/client.go
+++ b/client.go
@@ -2511,8 +2511,8 @@ func (cl *Client) verifyPiece(t *torrent, piece int) {
                cl.event.Wait()
        }
        p.QueuedForHash = false
-       t.publishPieceChange(piece)
        if t.isClosed() || t.pieceComplete(piece) {
+               t.publishPieceChange(piece)
                return
        }
        p.Hashing = true