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

Skip to content
Snippets Groups Projects
Verified Commit 9fc97764 authored by zzz's avatar zzz
Browse files

NetDB: Verify RI stores for a while after starting

parent 2813d941
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ class FloodfillStoreJob extends StoreJob {
private final FloodfillNetworkDatabaseFacade _facade;
private static final String PROP_RI_VERIFY = "router.verifyRouterInfoStore";
private static final long RI_VERIFY_STARTUP_TIME = 3*60*60*1000L;
/**
* Send a data structure to the floodfills
......@@ -69,7 +70,8 @@ class FloodfillStoreJob extends StoreJob {
_log.info("Skipping verify, one already in progress for: " + key);
return;
}
if (getContext().router().gracefulShutdownInProgress()) {
RouterContext ctx = getContext();
if (ctx.router().gracefulShutdownInProgress()) {
if (shouldLog)
_log.info("Skipping verify, shutdown in progress for: " + key);
return;
......@@ -80,7 +82,9 @@ class FloodfillStoreJob extends StoreJob {
final int type = data.getType();
final boolean isRouterInfo = type == DatabaseEntry.KEY_TYPE_ROUTERINFO;
// default false since 0.9.7.1
if (isRouterInfo && !getContext().getBooleanProperty(PROP_RI_VERIFY)) {
// verify for a while after startup until we've vetted the floodfills
if (isRouterInfo && !ctx.getBooleanProperty(PROP_RI_VERIFY) &&
ctx.router().getUptime() > RI_VERIFY_STARTUP_TIME) {
_facade.routerInfoPublishSuccessful();
return;
}
......@@ -105,13 +109,13 @@ class FloodfillStoreJob extends StoreJob {
} else {
client = key;
}
Job fvsj = new FloodfillVerifyStoreJob(getContext(), key, client,
Job fvsj = new FloodfillVerifyStoreJob(ctx, key, client,
published, type,
sentTo, _facade);
if (shouldLog)
_log.info(getJobId() + ": Succeeded sending key " + key +
", queueing verify job " + fvsj.getJobId());
getContext().jobQueue().addJob(fvsj);
ctx.jobQueue().addJob(fvsj);
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment