2
0
mirror of synced 2025-02-24 22:58:28 +00:00
torrent/worst_conns.go

12 lines
269 B
Go
Raw Normal View History

package torrent
2016-07-06 00:42:16 +10:00
func worseConn(l, r *connection) bool {
if l.useful() != r.useful() {
return r.useful()
}
2016-07-06 00:42:16 +10:00
if !l.lastHelpful().Equal(r.lastHelpful()) {
return l.lastHelpful().Before(r.lastHelpful())
}
2016-07-06 00:42:16 +10:00
return l.completedHandshake.Before(r.completedHandshake)
}