forked from I2P_Developers/i2p.i2p
* i2psnark:
- Adjust target piece size calculation - Tweak to make it easier for new peers to connect
This commit is contained in:
@ -376,10 +376,10 @@ class PeerCoordinator implements PeerListener
|
||||
*/
|
||||
public boolean needOutboundPeers() {
|
||||
//return wantedBytes != 0 && needPeers();
|
||||
// minus one to make it a little easier for new peers to get in on large swarms
|
||||
// minus two to make it a little easier for new peers to get in on large swarms
|
||||
return wantedBytes != 0 &&
|
||||
!halted &&
|
||||
peers.size() < getMaxConnections() - 1 &&
|
||||
peers.size() < getMaxConnections() - 2 &&
|
||||
(storage == null || !storage.isChecking());
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ public class Storage
|
||||
else
|
||||
pc_size = DEFAULT_PIECE_SIZE;
|
||||
int pcs = (int) ((total - 1)/pc_size) + 1;
|
||||
while (pcs > MAX_PIECES && pc_size < MAX_PIECE_SIZE)
|
||||
while (pcs > (MAX_PIECES * 2 / 3) && pc_size < MAX_PIECE_SIZE)
|
||||
{
|
||||
pc_size *= 2;
|
||||
pcs = (int) ((total - 1)/pc_size) +1;
|
||||
|
Reference in New Issue
Block a user