diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java
index 1a207763a..085ac3172 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java
@@ -39,7 +39,7 @@ import net.i2p.util.OrderedProperties;
import net.i2p.util.VersionComparator;
public class NetDbRenderer {
- private RouterContext _context;
+ private final RouterContext _context;
public NetDbRenderer (RouterContext ctx) {
_context = ctx;
@@ -119,12 +119,19 @@ public class NetDbRenderer {
fmt = null;
}
leases.addAll(_context.netDb().getLeases());
- int medianCount = leases.size() / 2;
+ int medianCount = 0;
BigInteger median = null;
int c = 0;
+ if (debug) {
+ // Find the center of the RAP leasesets
+ for (LeaseSet ls : leases) {
+ if (ls.getReceivedAsPublished())
+ medianCount++;
+ }
+ medianCount /= 2;
+ }
long now = _context.clock().now();
- for (Iterator iter = leases.iterator(); iter.hasNext(); ) {
- LeaseSet ls = (LeaseSet)iter.next();
+ for (LeaseSet ls : leases) {
Destination dest = ls.getDestination();
Hash key = dest.calculateHash();
buf.append("").append(_("LeaseSet")).append(": ").append(key.toBase64());
@@ -153,13 +160,15 @@ public class NetDbRenderer {
else
buf.append(_("Expired {0} ago", DataHelper.formatDuration2(0-exp))).append("
\n");
if (debug) {
- buf.append("RAP? " + ls.getReceivedAsPublished() + ' ');
- buf.append("RAR? " + ls.getReceivedAsReply() + ' ');
+ buf.append("RAP? " + ls.getReceivedAsPublished());
+ buf.append(" RAR? " + ls.getReceivedAsReply());
BigInteger dist = HashDistance.getDistance(ourRKey, ls.getRoutingKey());
- if (c++ == medianCount)
- median = dist;
- buf.append("Dist: " + fmt.format(biLog2(dist)) + " ");
- buf.append("RKey: " + ls.getRoutingKey().toBase64() + ' ');
+ if (ls.getReceivedAsPublished()) {
+ if (c++ == medianCount)
+ median = dist;
+ }
+ buf.append(" Dist: ").append(fmt.format(biLog2(dist))).append("");
+ buf.append(" RKey: ").append(ls.getRoutingKey().toBase64());
buf.append("
");
}
for (int i = 0; i < ls.getLeaseCount(); i++) {
@@ -174,9 +183,9 @@ public class NetDbRenderer {
if (debug) {
buf.append("
Total Leasesets: " + leases.size()); buf.append("
Published (RAP) Leasesets: " + _context.netDb().getKnownLeaseSets()); - buf.append("
Mod Data: " + HexDump.dump(_context.routingKeyGenerator().getModData())); + //buf.append("
Mod Data: " + HexDump.dump(_context.routingKeyGenerator().getModData())); buf.append("
Network data (only valid if floodfill):"); - buf.append("
Center of Key Space (router hash): " + ourRKey.toBase64()); + //buf.append("
Center of Key Space (router hash): " + ourRKey.toBase64()); if (median != null) { double log2 = biLog2(median); buf.append("
Median distance (bits): " + fmt.format(log2)); diff --git a/history.txt b/history.txt index 71b6d9206..67e5b6cfa 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,7 @@ +2012-02-17 zzz + * i2psnark: Escape fixes + * netdb.jsp: Fix debug median calculation + 20112-02-17 kytv * Add Czech language from Transifex (thanks Waseihou) diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 7f4edb975..affa6f41b 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,10 +18,10 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 13; + public final static long BUILD = 14; /** for example "-test" */ - public final static String EXTRA = ""; + public final static String EXTRA = "-rc"; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public static void main(String args[]) { System.out.println("I2P Router version: " + FULL_VERSION);