forked from I2P_Developers/i2p.i2p
* i2psnark:
- Split buckets correctly - More exploration fixes
This commit is contained in:
@ -89,8 +89,13 @@ class DHTNodes {
|
||||
* @return the old value if present, else null
|
||||
*/
|
||||
public NodeInfo putIfAbsent(NodeInfo nInfo) {
|
||||
_kad.add(nInfo.getNID());
|
||||
return _nodeMap.putIfAbsent(nInfo.getNID(), nInfo);
|
||||
NodeInfo rv = _nodeMap.putIfAbsent(nInfo.getNID(), nInfo);
|
||||
// ensure same object in both places
|
||||
if (rv != null)
|
||||
_kad.add(rv.getNID());
|
||||
else
|
||||
_kad.add(nInfo.getNID());
|
||||
return rv;
|
||||
}
|
||||
|
||||
public NodeInfo remove(NID nid) {
|
||||
|
@ -1108,8 +1108,12 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
|
||||
if (nInfo.equals(_myNodeInfo))
|
||||
return _myNodeInfo;
|
||||
NodeInfo rv = _knownNodes.putIfAbsent(nInfo);
|
||||
if (rv == null)
|
||||
if (rv == null) {
|
||||
rv = nInfo;
|
||||
// if we didn't know about it before, set the timestamp
|
||||
// so it isn't immediately removed by the DHTNodes cleaner
|
||||
rv.getNID().setLastSeen();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1638,7 +1638,7 @@ public class I2PSnarkServlet extends DefaultServlet {
|
||||
out.write("\" ></td></tr>\n" +
|
||||
|
||||
"<tr><td>");
|
||||
out.write(_("Enable DHT") + " (**BETA**)");
|
||||
out.write(_("Enable DHT"));
|
||||
out.write(": <td><input type=\"checkbox\" class=\"optbox\" name=\"useDHT\" value=\"true\" "
|
||||
+ (useDHT ? "checked " : "")
|
||||
+ "title=\"");
|
||||
|
Reference in New Issue
Block a user