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

Skip to content
Snippets Groups Projects
Commit 71aa0cfb authored by zzz's avatar zzz
Browse files

* FloodfillPeerSelector: Adjust rankings to try to

      improve LeaseSet lookups
parent 55e45c42
No related branches found
No related tags found
No related merge requests found
...@@ -112,7 +112,7 @@ class FloodfillPeerSelector extends PeerSelector { ...@@ -112,7 +112,7 @@ class FloodfillPeerSelector extends PeerSelector {
private static final int NO_FAIL_STORE_OK = 10*60*1000; private static final int NO_FAIL_STORE_OK = 10*60*1000;
private static final int NO_FAIL_STORE_GOOD = NO_FAIL_STORE_OK * 2; private static final int NO_FAIL_STORE_GOOD = NO_FAIL_STORE_OK * 2;
/** this must be longer than the max streaming timeout (60s) */ /** this must be longer than the max streaming timeout (60s) */
private static final int NO_FAIL_LOOKUP_OK = 2*60*1000; private static final int NO_FAIL_LOOKUP_OK = 3*60*1000;
private static final int NO_FAIL_LOOKUP_GOOD = NO_FAIL_LOOKUP_OK * 3; private static final int NO_FAIL_LOOKUP_GOOD = NO_FAIL_LOOKUP_OK * 3;
private static final int MAX_GOOD_RESP_TIME = 5*1000; private static final int MAX_GOOD_RESP_TIME = 5*1000;
...@@ -135,8 +135,11 @@ class FloodfillPeerSelector extends PeerSelector { ...@@ -135,8 +135,11 @@ class FloodfillPeerSelector extends PeerSelector {
maxFailRate = 100d; // disable maxFailRate = 100d; // disable
} }
// 8 == FNDF.MAX_TO_FLOOD + 1
int limit = Math.max(8, howMany);
limit = Math.min(limit, ffs.size());
// split sorted list into 3 sorted lists // split sorted list into 3 sorted lists
for (int i = 0; found < howMany && i < ffs.size(); i++) { for (int i = 0; found < howMany && i < limit; i++) {
Hash entry = sorted.first(); Hash entry = sorted.first();
sorted.remove(entry); sorted.remove(entry);
if (entry == null) if (entry == null)
......
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