forked from I2P_Developers/i2p.i2p
Improve rarest-first behavior by not favoring a partial piece
held by multiple peers when requesting from a seed
This commit is contained in:
@@ -57,6 +57,15 @@ class Piece implements Comparable {
|
||||
/** caller must synchronize */
|
||||
public boolean removePeer(Peer peer) { return this.peers.remove(peer.getPeerID()); }
|
||||
|
||||
/**
|
||||
* How many peers have this piece?
|
||||
* Caller must synchronize
|
||||
* @since 0.9.1
|
||||
*/
|
||||
public int getPeerCount() {
|
||||
return this.peers.size();
|
||||
}
|
||||
|
||||
/** caller must synchronize */
|
||||
public boolean isRequested() {
|
||||
return this.requests != null && !this.requests.isEmpty();
|
||||
|
||||
Reference in New Issue
Block a user