]> Sergey Matveev's repositories - btrtrc.git/blobdiff - connection.go
Kick only the worst connection when a piece fails a check
[btrtrc.git] / connection.go
index 94451c6de6d6939dda04e1f72aef6f30d116cb01..727f97f7846db605da1f43f487d3e8644e56ed77 100644 (file)
@@ -1068,3 +1068,7 @@ func (cn *connection) Drop() {
 func (cn *connection) sentHave(piece int) bool {
        return piece < len(cn.sentHaves) && cn.sentHaves[piece]
 }
+
+func (cn *connection) netGoodPiecesDirtied() int {
+       return cn.goodPiecesDirtied - cn.badPiecesDirtied
+}