Log dropping of bad peers in debug mode only
This commit is contained in:
parent
b9a1cb5b8b
commit
54a7d83c45
14
torrent.go
14
torrent.go
|
@ -1484,12 +1484,14 @@ func (t *Torrent) pieceHashed(piece int, correct bool) {
|
|||
c.badPiecesDirtied++
|
||||
}
|
||||
slices.Sort(touchers, connLessTrusted)
|
||||
log.Printf("dropping first corresponding conn from trust: %v", func() (ret []int) {
|
||||
for _, c := range touchers {
|
||||
ret = append(ret, c.netGoodPiecesDirtied())
|
||||
}
|
||||
return
|
||||
}())
|
||||
if t.cl.config.Debug {
|
||||
log.Printf("dropping first corresponding conn from trust: %v", func() (ret []int) {
|
||||
for _, c := range touchers {
|
||||
ret = append(ret, c.netGoodPiecesDirtied())
|
||||
}
|
||||
return
|
||||
}())
|
||||
}
|
||||
c := touchers[0]
|
||||
t.cl.banPeerIP(missinggo.AddrIP(c.remoteAddr()))
|
||||
c.Drop()
|
||||
|
|
Loading…
Reference in New Issue