]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Write received chunks that we don't have
authorMatt Joiner <anacrolix@gmail.com>
Sun, 24 Jun 2018 09:40:53 +0000 (19:40 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 24 Jun 2018 09:40:53 +0000 (19:40 +1000)
Chunks were discarded if they belong to unprioritized pieces, even if those pieces were previously prioritized. May be contributing to #253.

connection.go

index e5075887accc5921a05d7d3ff01403aa7c0f0164..53bf211681b6b74abe463fdf2cd7db568c086562 100644 (file)
@@ -1228,7 +1228,7 @@ func (c *connection) receiveChunk(msg *pp.Message) {
        }
 
        // Do we actually want this chunk?
-       if !t.wantPiece(req) {
+       if t.haveChunk(req) {
                torrent.Add("chunks received unwanted", 1)
                c.allStats(add(1, func(cs *ConnStats) *Count { return &cs.ChunksReadUnwanted }))
                return