I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 269223f7 authored by obscuratus i2p's avatar obscuratus i2p
Browse files

NetDb: Set Default Number of FF Peers for New SubDb to Zero.


Client subDb will not handle RI in normal use cases, and
FF RI are not necessary for any known aspect of their operation.

This change removes initial testing provisions that insured
the subDb were prepopulated with some number of FF RI.

Signed-off-by: default avatarobscuratus <obscuratus@mail.i2p>
parent dbacad56
No related branches found
No related tags found
1 merge request!101Nested NetDb Branch Redux
...@@ -296,16 +296,19 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad ...@@ -296,16 +296,19 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
} }
public int minFloodfillPeers() { public int minFloodfillPeers() {
int mfp = _context.getProperty(MINIMUM_SUBDB_PEERS, 3); int mfp = _context.getProperty(MINIMUM_SUBDB_PEERS, 0);
return mfp; return mfp;
} }
public List<RouterInfo> pickRandomFloodfillPeers() { public List<RouterInfo> pickRandomFloodfillPeers() {
List<RouterInfo> list = new ArrayList<RouterInfo>(); List<RouterInfo> list = new ArrayList<RouterInfo>();
// In normal operation, client subDb do not need RI.
// pickRandomFloodfillPeers() is provided for future use cases.
// get the total number of known routers // get the total number of known routers
int count = getFloodfillPeers().size(); int count = getFloodfillPeers().size();
if (count == 0) if ((count == 0) || (minFloodfillPeers() == 0))
return list; return list; // Return empty list.
// pick a random number of routers between 4 and 4+1% of the total routers we know about. // pick a random number of routers between 4 and 4+1% of the total routers we know about.
int max = minFloodfillPeers() + (count / 100); int max = minFloodfillPeers() + (count / 100);
while (list.size() < max) { while (list.size() < max) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment