forked from I2P_Developers/i2p.i2p
2007-03-08 zzz
* i2psnark changes to improve upload performance: * Implement total uploader limit (10) * Don't timeout non-piece messages out * Change chunk size to 32K (was 64K) * Change request limit to 64K (was 256K) * i2psnark: Disconnect from seeds when complete
This commit is contained in:
@ -507,6 +507,21 @@ public class Peer implements Comparable
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if a peer is a seeder
|
||||
* Quite inefficient - a byte lookup table or counter in Bitfield would be much better
|
||||
*/
|
||||
public boolean isCompleted()
|
||||
{
|
||||
PeerState s = state;
|
||||
if (s == null || s.bitfield == null)
|
||||
return false;
|
||||
for (int i = 0; i < s.bitfield.size(); i++)
|
||||
if (!s.bitfield.get(i))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Push the total uploaded/downloaded onto a RATE_DEPTH deep stack
|
||||
*/
|
||||
|
Reference in New Issue
Block a user