1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

piece availability should not be considered if no peers have it

This commit is contained in:
Mitchell Livingston 2007-02-14 02:02:44 +00:00
parent e2ba015b25
commit 7d569e7981

View file

@ -1341,8 +1341,6 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
index = (int)indexValue;
}
free(piecesAvailablity);
//determine percentage finished and available
int have, avail;
if ([self progress] >= 1.0)
@ -1362,7 +1360,10 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
float available = 0;
for (i = 0; i < pieceCount; i++)
{
if (piecesAvailablity[i] > 0)
available += 1.0 - piecesFinished[i];
}
have = rintf((float)MAX_PIECES * [self progress]);
avail = rintf((float)MAX_PIECES * available / (float)pieceCount);
@ -1372,6 +1373,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
free(piecesFinished);
}
free(piecesAvailablity);
//first two lines: dark blue to show progression, green to show available
p = (uint32_t *)bitmapData;
for (i = 0; i < have; i++)