forked from I2P_Developers/i2p.i2p
* i2psnark: Restrict swarm size for small torrents
This commit is contained in:
@ -342,6 +342,11 @@ public class PeerCoordinator implements PeerListener
|
||||
private int getMaxConnections() {
|
||||
if (metainfo == null)
|
||||
return 6;
|
||||
int pieces = metainfo.getPieces();
|
||||
if (pieces <= 2)
|
||||
return 4;
|
||||
if (pieces <= 5)
|
||||
return 6;
|
||||
int size = metainfo.getPieceLength(0);
|
||||
int max = _util.getMaxConnections();
|
||||
if (size <= 512*1024 || completed())
|
||||
|
Reference in New Issue
Block a user