forked from I2P_Developers/i2p.i2p
NetDB: Don't publish non-ff RI on exit if we are coming right back
This commit is contained in:
@@ -34,7 +34,7 @@ class FloodfillMonitorJob extends JobImpl {
|
|||||||
|
|
||||||
private static final int MIN_FF = 5000;
|
private static final int MIN_FF = 5000;
|
||||||
private static final int MAX_FF = 999999;
|
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) {
|
public FloodfillMonitorJob(RouterContext context, FloodfillNetworkDatabaseFacade facade) {
|
||||||
super(context);
|
super(context);
|
||||||
|
@@ -94,7 +94,11 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized void shutdown() {
|
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...
|
// turn off to build a new RI...
|
||||||
_floodfillEnabled = false;
|
_floodfillEnabled = false;
|
||||||
// true -> publish inline
|
// true -> publish inline
|
||||||
|
Reference in New Issue
Block a user