forked from I2P_Developers/i2p.i2p
merge of '22cebc21c21e3a101e03165f26a5e9fddc3648da'
and 'e210f94f3d17359b39a6b24f2a5e1221a86abfd0'
This commit is contained in:
@ -155,7 +155,7 @@ public class ConfigServiceHandler extends FormHandler {
|
||||
|
||||
/**
|
||||
* Register a handler for signals,
|
||||
* so we can handle HUP from the wrapper (non-Windows only, wrapper 3.2.0 or higher)
|
||||
* so we can handle HUP from the wrapper (wrapper 3.2.0 or higher)
|
||||
*
|
||||
* @since 0.8.13
|
||||
*/
|
||||
|
@ -64,8 +64,11 @@ class SybilRenderer {
|
||||
private static final double MIN_CLOSE = 242.0;
|
||||
private static final double PAIR_DISTANCE_FACTOR = 2.0;
|
||||
private static final double OUR_KEY_FACTOR = 4.0;
|
||||
private static final double MIN_DISPLAY_POINTS = 3.0;
|
||||
private static final double MIN_DISPLAY_POINTS = 5.0;
|
||||
private static final double VERSION_FACTOR = 1.0;
|
||||
private static final double POINTS_BAD_VERSION = 50.0;
|
||||
private static final double POINTS_UNREACHABLE = 4.0;
|
||||
private static final double POINTS_NEW = 4.0;
|
||||
|
||||
public SybilRenderer(RouterContext ctx) {
|
||||
_context = ctx;
|
||||
@ -616,8 +619,8 @@ class SybilRenderer {
|
||||
if (heard > 0) {
|
||||
long age = Math.max(now - heard, 1);
|
||||
if (age < 2 * DAY) {
|
||||
// .125 point for every hour under 48, max 6 points
|
||||
double point = Math.min(6.0d, (2 * DAY - age) / (2 * DAY / 6.0d));
|
||||
// (POINTS_NEW / 48) for every hour under 48, max POINTS_NEW
|
||||
double point = Math.min(POINTS_NEW, (2 * DAY - age) / (2 * DAY / POINTS_NEW));
|
||||
addPoints(points, h, point,
|
||||
"First heard about: " + _t("{0} ago", DataHelper.formatDuration2(age)));
|
||||
}
|
||||
@ -656,9 +659,12 @@ class SybilRenderer {
|
||||
} catch (NumberFormatException nfe) { return; }
|
||||
for (RouterInfo info : ris) {
|
||||
Hash h = info.getHash();
|
||||
String caps = info.getCapabilities();
|
||||
if (!caps.contains("R"))
|
||||
addPoints(points, h, POINTS_UNREACHABLE, "Unreachable: " + DataHelper.escapeHTML(caps));
|
||||
String hisFullVer = info.getVersion();
|
||||
if (!hisFullVer.startsWith("0.9.")) {
|
||||
addPoints(points, h, 50.0, "Strange version " + DataHelper.escapeHTML(hisFullVer));
|
||||
addPoints(points, h, POINTS_BAD_VERSION, "Strange version " + DataHelper.escapeHTML(hisFullVer));
|
||||
continue;
|
||||
}
|
||||
String hisVer = hisFullVer.substring(4);
|
||||
|
Reference in New Issue
Block a user