diff --git a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java index 231e3a64898842d8ecc10c8f860e0436e2e4fedf..5e5729ebbca1af04a8b94e1bf04c6d406a16b1f2 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java @@ -65,7 +65,7 @@ class TunnelRenderer { List<HopConfig> participating = _context.tunnelDispatcher().listParticipatingTunnels(); out.write("<h3 class=\"tabletitle\" id=\"participating\">" + _t("Participating tunnels") + "</h3>\n"); - int bwShare = _context.bandwidthLimiter().getOutboundKBytesPerSecond(); + int bwShare = getShareBandwidth(); if (bwShare > 12) { // Don't bother re-indenting if (!participating.isEmpty()) { @@ -384,6 +384,19 @@ class TunnelRenderer { return _context.commSystem().renderPeerHTML(peer); } + /** + * Copied from ConfigNetHelper. + * @return in KBytes per second + */ + private int getShareBandwidth() { + int irateKBps = _context.bandwidthLimiter().getInboundKBytesPerSecond(); + int orateKBps = _context.bandwidthLimiter().getOutboundKBytesPerSecond(); + double pct = _context.router().getSharePercentage(); + if (irateKBps < 0 || orateKBps < 0) + return ConfigNetHelper.DEFAULT_SHARE_KBPS; + return (int) (pct * Math.min(irateKBps, orateKBps)); + } + /** translate a string */ private String _t(String s) { return Messages.getString(s, _context); diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index c10128fe6223a59f4fa2320e38c3309487438a87..fecba78d6973d87e9930d631de787e05fec2a510 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 6; + public final static long BUILD = 7; /** for example "-test" */ public final static String EXTRA = "";