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 53af2c0fe..829c68015 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java @@ -94,7 +94,7 @@ public class NetDbRenderer { } /** - * @param debug @since 0.7.14 sort by routing key, display distance from our routing key + * @param debug @since 0.7.14 sort by distance from us, display * median distance, and other stuff, useful when floodfill */ public void renderLeaseSetHTML(Writer out, boolean debug) throws IOException { @@ -106,7 +106,7 @@ public class NetDbRenderer { Set leases; DecimalFormat fmt; if (debug) { - ourRKey = _context.routingKeyGenerator().getRoutingKey(_context.routerHash()); + ourRKey = _context.routerHash(); leases = new TreeSet(new LeaseSetRoutingKeyComparator(ourRKey)); fmt = new DecimalFormat("#0.00"); } else { @@ -169,13 +169,17 @@ public class NetDbRenderer { } if (debug) { buf.append("

Total Leasesets: " + leases.size()); - buf.append("

Our RKey: " + ourRKey.toBase64() + "

"); + buf.append("

Published (RAP) Leasesets: " + _context.netDb().getKnownLeaseSets()); 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() + "

"); if (median != null) { double log2 = biLog2(median); buf.append("

Median distance (bits): " + fmt.format(log2)); - // 1 for median, 3 for 8 floodfills... is this right? - buf.append("

Estimated total floodfills: " + Math.round(Math.pow(2, 1 + 3 + 255 - log2))); + // 3 for 8 floodfills... -1 for median + int total = (int) Math.round(Math.pow(2, 3 + 256 - 1 - log2)); + buf.append("

Estimated total floodfills: " + total); + buf.append("

Estimated network total leasesets: " + (total * leases.size() / 8)); } } out.write(buf.toString());