Changeset 05b40a2


Ignore:
Timestamp:
Dec 20, 2015 2:23:59 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
cc4bf8ea
Parents:
64f5c662
Message:

Sybil tool tweaks

File:
1 edited

Legend:

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

    r64f5c662 r05b40a2  
    6565    private static final double PAIR_DISTANCE_FACTOR = 2.0;
    6666    private static final double OUR_KEY_FACTOR = 4.0;
    67     private static final double MIN_DISPLAY_POINTS = 3.0;
     67    private static final double MIN_DISPLAY_POINTS = 5.0;
    6868    private static final double VERSION_FACTOR = 1.0;
     69    private static final double POINTS_BAD_VERSION = 50.0;
     70    private static final double POINTS_UNREACHABLE = 4.0;
     71    private static final double POINTS_NEW = 4.0;
    6972
    7073    public SybilRenderer(RouterContext ctx) {
     
    617620                    long age = Math.max(now - heard, 1);
    618621                    if (age < 2 * DAY) {
    619                         // .125 point for every hour under 48, max 6 points
    620                         double point = Math.min(6.0d, (2 * DAY - age) / (2 * DAY / 6.0d));
     622                        // (POINTS_NEW / 48) for every hour under 48, max POINTS_NEW
     623                        double point = Math.min(POINTS_NEW, (2 * DAY - age) / (2 * DAY / POINTS_NEW));
    621624                        addPoints(points, h, point,
    622625                                  "First heard about: " + _t("{0} ago", DataHelper.formatDuration2(age)));
     
    657660        for (RouterInfo info : ris) {
    658661            Hash h = info.getHash();
     662            String caps = info.getCapabilities();
     663            if (!caps.contains("R"))
     664                addPoints(points, h, POINTS_UNREACHABLE, "Unreachable: " + DataHelper.escapeHTML(caps));
    659665            String hisFullVer = info.getVersion();
    660666            if (!hisFullVer.startsWith("0.9.")) {
    661                 addPoints(points, h, 50.0, "Strange version " + DataHelper.escapeHTML(hisFullVer));
     667                addPoints(points, h, POINTS_BAD_VERSION, "Strange version " + DataHelper.escapeHTML(hisFullVer));
    662668                continue;
    663669            }
Note: See TracChangeset for help on using the changeset viewer.