FedP2P/worst_conns.go

12 lines
269 B
Go
Raw Normal View History

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