diff --git a/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java index d6882f0a6..00293a567 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java @@ -32,6 +32,7 @@ public class EventLogHelper extends FormHandler { private static final String ALL = "all"; private static final String[] _events = new String[] { EventLog.ABORTED, _x("Aborted startup"), + EventLog.BECAME_FLOODFILL, _x("Enabled floodfill"), EventLog.CHANGE_IP, _x("Changed IP"), EventLog.CHANGE_PORT, _x("Changed port"), EventLog.CLOCK_SHIFT, _x("Clock shifted"), @@ -41,6 +42,7 @@ public class EventLogHelper extends FormHandler { EventLog.INSTALL_FAILED, _x("Install failed"), EventLog.NETWORK, _x("Network error"), EventLog.NEW_IDENT, _x("New router identity"), + EventLog.NOT_FLOODFILL, _x("Disabled floodfill"), EventLog.OOM, _x("Out of memory error"), EventLog.REKEYED, _x("New router identity"), EventLog.RESEED, _x("Reseeded router"), diff --git a/history.txt b/history.txt index 93eabed0f..e333f71cb 100644 --- a/history.txt +++ b/history.txt @@ -1,6 +1,7 @@ -2014-08-13 zzz +2014-08-13 zzz, dg * Console: Escaping fix (ticket #1346) * i2psnark: Fix add torrent NPE + * Console, EventLog: add BECAME_FLOODFILL and NOT_FLOODFILL, they are now shown at the /events page when the router changes its floodfill state 2014-08-10 zzz Prop from i2p.i2p.zzz.snarkconfig: 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 c61ed40f1..99c4beda2 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java @@ -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); diff --git a/router/java/src/net/i2p/router/util/EventLog.java b/router/java/src/net/i2p/router/util/EventLog.java index 086fbbdc5..ef59c5fc6 100644 --- a/router/java/src/net/i2p/router/util/EventLog.java +++ b/router/java/src/net/i2p/router/util/EventLog.java @@ -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";