Favour earlier pieces

This commit is contained in:
Matt Joiner 2015-01-11 00:17:18 +11:00
parent 78caa4533b
commit bcebf569b8
1 changed files with 2 additions and 0 deletions

View File

@ -104,6 +104,8 @@ func (cn *connection) pendPiece(piece int, priority piecePriority) {
case piecePriorityNow:
key -= len(cn.piecePriorities)
}
// Favour earlier pieces more than later pieces.
key -= piece / 2
cn.pieceRequestOrder.SetPiece(piece, key)
}