From a2f027e1365b83e9b1fcec715cf5b8ff63aa99fe Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Wed, 18 Mar 2015 19:58:31 +0000 Subject: [PATCH] NetDB: Don't publish non-ff RI on exit if we are coming right back --- .../i2p/router/networkdb/kademlia/FloodfillMonitorJob.java | 2 +- .../networkdb/kademlia/FloodfillNetworkDatabaseFacade.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java index 056f6a607a..4ed44388c0 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java @@ -34,7 +34,7 @@ class FloodfillMonitorJob extends JobImpl { private static final int MIN_FF = 5000; private static final int MAX_FF = 999999; - private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant"; + static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant"; public FloodfillMonitorJob(RouterContext context, FloodfillNetworkDatabaseFacade facade) { super(context); diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java index ab41b7166d..a02013a5f8 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java @@ -94,7 +94,11 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad */ @Override public synchronized void shutdown() { - if (_floodfillEnabled) { + // only if not forced ff or not restarting + if (_floodfillEnabled && + (!_context.getBooleanProperty(FloodfillMonitorJob.PROP_FLOODFILL_PARTICIPANT) || + !(_context.router().scheduledGracefulExitCode() == Router.EXIT_HARD_RESTART || + _context.router().scheduledGracefulExitCode() == Router.EXIT_GRACEFUL_RESTART))) { // turn off to build a new RI... _floodfillEnabled = false; // true -> publish inline -- GitLab