Console: Don't force profile creation when loading floodfill tab

Don't show negative times
Sybil tool: tweaks
TunnelRenderer: minor cleanup
This commit is contained in:
zzz
2015-12-06 16:47:34 +00:00
parent 826bb54984
commit b6e8431bce
3 changed files with 10 additions and 9 deletions

View File

@ -47,7 +47,7 @@ class ProfileOrganizerRenderer {
int standard = 0;
for (Hash peer : peers) {
if (_organizer.getUs().equals(peer)) continue;
PeerProfile prof = _organizer.getProfile(peer);
PeerProfile prof = _organizer.getProfileNonblocking(peer);
if (prof == null)
continue;
if (mode == 2) {
@ -366,6 +366,9 @@ class ProfileOrganizerRenderer {
private String formatInterval(long now, long then) {
if (then <= 0)
return _t(NA);
// avoid 0 or negative
if (now <= then)
return DataHelper.formatDuration2(1);
return DataHelper.formatDuration2(now - then);
}

View File

@ -48,9 +48,9 @@ class SybilRenderer {
private static final int PAIRMAX = 20;
private static final int MAX = 10;
// multiplied by size - 1, will also get POINTS24 added
private static final double POINTS32 = 10.0;
private static final double POINTS32 = 5.0;
// multiplied by size - 1, will also get POINTS16 added
private static final double POINTS24 = 10.0;
private static final double POINTS24 = 5.0;
// multiplied by size - 1
private static final double POINTS16 = 0.25;
private static final double MIN_CLOSE = 242.0;
@ -211,7 +211,7 @@ class SybilRenderer {
buf.append("<h3>Closest floodfills to the Routing Key for " + DataHelper.escapeHTML(name) + " (where we store our LS)</h3>");
renderRouterInfoHTML(out, buf, rkey, avgMinDist, ris, points);
nkey = rkgen.getNextRoutingKey(ls.getHash());
buf.append("<h3>Closest floodfills to Tomorrow's Routing Key for " + DataHelper.escapeHTML(name) + " (where we store our LS)</h3>");
buf.append("<h3>Closest floodfills to Tomorrow's Routing Key for " + DataHelper.escapeHTML(name) + " (where we will store our LS)</h3>");
renderRouterInfoHTML(out, buf, nkey, avgMinDist, ris, points);
}

View File

@ -46,12 +46,10 @@ public class TunnelRenderer {
boolean isLocal = _context.clientManager().isLocal(client);
if ((!isLocal) && (!debug))
continue;
TunnelPool in = null;
TunnelPool outPool = null;
in = clientInboundPools.get(client);
outPool = clientOutboundPools.get(client);
TunnelPool in = clientInboundPools.get(client);
TunnelPool outPool = clientOutboundPools.get(client);
// TODO the following code is duplicated in SummaryHelper
String name = (in != null ? in.getSettings().getDestinationNickname() : null);
String name = (in != null) ? in.getSettings().getDestinationNickname() : null;
if ( (name == null) && (outPool != null) )
name = outPool.getSettings().getDestinationNickname();
if (name == null)