torrent/worst_conns.go

12 lines
269 B
Go

package torrent
func worseConn(l, r *connection) bool {
if l.useful() != r.useful() {
return r.useful()
}
if !l.lastHelpful().Equal(r.lastHelpful()) {
return l.lastHelpful().Before(r.lastHelpful())
}
return l.completedHandshake.Before(r.completedHandshake)
}