peerconn.go | 1 + requesting.go | 3 +++ diff --git a/peerconn.go b/peerconn.go index 8e1f654d7ad022327eda0db3e859dadcb2da70e6..c7a4e8cfceddacfda1f16d4e3ff8296990e5f0a3 100644 --- a/peerconn.go +++ b/peerconn.go @@ -1335,6 +1335,7 @@ cl := t.cl // Do we actually want this chunk? if t.haveChunk(ppReq) { + //panic(fmt.Sprintf("%+v", ppReq)) chunksReceived.Add("wasted", 1) c.allStats(add(1, func(cs *ConnStats) *Count { return &cs.ChunksReadWasted })) return nil diff --git a/requesting.go b/requesting.go index 669b0d2a78b30cedcc2bca7ac04bde0a594906f0..462d681836e44a7d051ef8c535463614aa28fe56 100644 --- a/requesting.go +++ b/requesting.go @@ -215,6 +215,9 @@ } allowedFast := p.peerAllowedFast.ContainsInt(pieceIndex) rsp.IterPendingChunks.Iter(func(ci request_strategy.ChunkIndex) { r := p.t.pieceRequestIndexOffset(pieceIndex) + ci + //if p.t.pendingRequests.Get(r) != 0 && !p.actualRequestState.Requests.Contains(r) { + // return + //} if !allowedFast { // We must signal interest to request this desired.Interested = true