forked from I2P_Developers/i2p.i2p
* Console, EventLog: Added {BECAME,NOT}_FLOODFILL events. They will now be shown on the console's /events page when the router's ff status changes.
* EventLog: Fix a minor typo.
This commit is contained in:
@ -9,6 +9,7 @@ import net.i2p.router.JobImpl;
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.peermanager.PeerProfile;
|
||||
import net.i2p.router.util.EventLog;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
@ -42,8 +43,14 @@ class FloodfillMonitorJob extends JobImpl {
|
||||
boolean wasFF = _facade.floodfillEnabled();
|
||||
boolean ff = shouldBeFloodfill();
|
||||
_facade.setFloodfillEnabled(ff);
|
||||
if (ff != wasFF)
|
||||
if (ff != wasFF) {
|
||||
if(ff) {
|
||||
getContext().router().eventLog().addEvent(EventLog.BECAME_FLOODFILL);
|
||||
} else {
|
||||
getContext().router().eventLog().addEvent(EventLog.NOT_FLOODFILL);
|
||||
}
|
||||
getContext().router().rebuildRouterInfo();
|
||||
}
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Should we be floodfill? " + ff);
|
||||
int delay = (REQUEUE_DELAY / 2) + getContext().random().nextInt(REQUEUE_DELAY);
|
||||
|
@ -32,15 +32,17 @@ public class EventLog {
|
||||
|
||||
/** for convenience, not required */
|
||||
public static final String ABORTED = "aborted";
|
||||
public static final String BECAME_FLOODFILL = "becameFloodfill";
|
||||
public static final String CHANGE_IP = "changeIP";
|
||||
public static final String CHANGE_PORT = "changePort";
|
||||
public static final String CLOCK_SHIFT = "clockShift";
|
||||
public static final String CRASHED = "crashed";
|
||||
public static final String CRITICAL = "critical";
|
||||
public static final String INSTALLED = "installed";
|
||||
public static final String INSTALL_FAILED = "intallFailed";
|
||||
public static final String INSTALL_FAILED = "installFailed";
|
||||
public static final String NETWORK = "network";
|
||||
public static final String NEW_IDENT = "newIdent";
|
||||
public static final String NOT_FLOODFILL = "disabledFloodfill";
|
||||
public static final String OOM = "oom";
|
||||
public static final String REKEYED = "rekeyed";
|
||||
public static final String RESEED = "reseed";
|
||||
|
Reference in New Issue
Block a user