From: Matt Joiner Date: Sun, 24 Jun 2018 09:40:53 +0000 (+1000) Subject: Write received chunks that we don't have X-Git-Tag: v1.0.0~124 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d2602c7935c682f0ddd173053e14ec96212960c9;p=btrtrc.git Write received chunks that we don't have Chunks were discarded if they belong to unprioritized pieces, even if those pieces were previously prioritized. May be contributing to #253. --- diff --git a/connection.go b/connection.go index e5075887..53bf2116 100644 --- a/connection.go +++ b/connection.go @@ -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