}
t.saveMetadataPiece(piece, payload[begin:])
c.stats.ChunksReadUseful++
+ c.t.stats.ChunksReadUseful++
c.lastUsefulChunkReceived = time.Now()
return t.maybeCompleteMetadata()
case pp.RequestMetadataExtensionMsgType:
if !t.wantPiece(req) {
unwantedChunksReceived.Add(1)
c.stats.ChunksReadUnwanted++
+ c.t.stats.ChunksReadUnwanted++
return
}
piece := &t.pieces[index]
c.stats.ChunksReadUseful++
+ c.t.stats.ChunksReadUseful++
+ c.stats.BytesReadUsefulData += int64(len(msg.Piece))
+ c.t.stats.BytesReadUsefulData += int64(len(msg.Piece))
c.lastUsefulChunkReceived = time.Now()
// if t.fastestConn != c {
// log.Printf("setting fastest connection %p", c)
}
p.everHashed = true
if correct {
+ if len(touchers) != 0 {
+ t.stats.PiecesDirtiedGood++
+ }
for _, c := range touchers {
c.stats.PiecesDirtiedGood++
}
}
} else {
if len(touchers) != 0 {
+ t.stats.PiecesDirtiedBad++
for _, c := range touchers {
// Y u do dis peer?!
c.stats.PiecesDirtiedBad++