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

Skip to content
Snippets Groups Projects
Unverified Commit 10e05960 authored by zzz's avatar zzz
Browse files

NetDB: Reduce min RI expiration

parent 62160812
No related branches found
No related tags found
No related merge requests found
...@@ -138,7 +138,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad ...@@ -138,7 +138,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
* know anyone or just started up) -- see validate() below * know anyone or just started up) -- see validate() below
*/ */
private final static long ROUTER_INFO_EXPIRATION = 27*60*60*1000l; private final static long ROUTER_INFO_EXPIRATION = 27*60*60*1000l;
private final static long ROUTER_INFO_EXPIRATION_MIN = 90*60*1000l; private final static long ROUTER_INFO_EXPIRATION_MIN = 60*60*1000l;
private final static long ROUTER_INFO_EXPIRATION_SHORT = 75*60*1000l; private final static long ROUTER_INFO_EXPIRATION_SHORT = 75*60*1000l;
private final static long ROUTER_INFO_EXPIRATION_FLOODFILL = 60*60*1000l; private final static long ROUTER_INFO_EXPIRATION_FLOODFILL = 60*60*1000l;
private final static long ROUTER_INFO_EXPIRATION_INTRODUCED = 54*60*1000l; private final static long ROUTER_INFO_EXPIRATION_INTRODUCED = 54*60*1000l;
...@@ -1166,7 +1166,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad ...@@ -1166,7 +1166,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
// As the net grows this won't be sufficient, and we'll have to implement // As the net grows this won't be sufficient, and we'll have to implement
// flushing some from memory, while keeping all on disk. // flushing some from memory, while keeping all on disk.
long adjustedExpiration; long adjustedExpiration;
if (floodfillEnabled()) if (floodfillEnabled() || (_ds != null && _ds.size() > 5000))
adjustedExpiration = ROUTER_INFO_EXPIRATION_FLOODFILL; adjustedExpiration = ROUTER_INFO_EXPIRATION_FLOODFILL;
else else
adjustedExpiration = Math.min(ROUTER_INFO_EXPIRATION, adjustedExpiration = Math.min(ROUTER_INFO_EXPIRATION,
......
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