Changeset e2a41b7


Ignore:
Timestamp:
Oct 7, 2018 2:52:24 PM (20 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e3d456c
Parents:
477fa9e
Message:

Console: Sort RAs in Sybil tool

Location:
apps/routerconsole/java/src/net/i2p/router/web/helpers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/NetDbRenderer.java

    r477fa9e re2a41b7  
    806806     *  @since 0.9.38
    807807     */
    808     private static class RAComparator implements Comparator<RouterAddress> {
     808    static class RAComparator implements Comparator<RouterAddress> {
    809809         private static final long serialVersionUID = 1L;
    810810
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/SybilRenderer.java

    r477fa9e re2a41b7  
    88import java.text.DecimalFormat;
    99import java.util.ArrayList;
     10import java.util.Collection;
    1011import java.util.Collections;
    1112import java.util.Comparator;
     
    913914        buf.append("<p class=\"sybil_filler\">&nbsp;</p>");
    914915        buf.append("</div></td></tr><tr><td class=\"sybil_addresses\" colspan=\"3\"><table><tr><td><b>" + _t("Addresses") + ":</b></td><td>");
    915         for (RouterAddress addr : info.getAddresses()) {
     916        Collection<RouterAddress> addrs = info.getAddresses();
     917        if (addrs.size() > 1) {
     918            // addrs is unmodifiable
     919            List<RouterAddress> laddrs = new ArrayList<RouterAddress>(addrs);
     920            Collections.sort(laddrs, new NetDbRenderer.RAComparator());
     921            addrs = laddrs;
     922        }
     923        for (RouterAddress addr : addrs) {
    916924            String style = addr.getTransportStyle();
    917925            buf.append("<br><b class=\"netdb_transport\">").append(DataHelper.stripHTML(style)).append(":</b> ");
Note: See TracChangeset for help on using the changeset viewer.