forked from I2P_Developers/i2p.i2p
* Data Structures: More caching and cleanups
This commit is contained in:
@@ -305,7 +305,7 @@ public class Blocklist {
|
||||
if (end1 - start1 == 44 && buf.substring(start1).indexOf(".") < 0) {
|
||||
byte b[] = Base64.decode(buf.substring(start1));
|
||||
if (b != null)
|
||||
return new Entry(comment, new Hash(b), null, null);
|
||||
return new Entry(comment, Hash.create(b), null, null);
|
||||
}
|
||||
index = buf.indexOf("-", start1);
|
||||
if (index >= 0) {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 5;
|
||||
public final static long BUILD = 6;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import net.i2p.data.Base64;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataStructure;
|
||||
import net.i2p.data.Hash;
|
||||
@@ -481,8 +482,12 @@ class PersistentDataStore extends TransientDataStore {
|
||||
try {
|
||||
String key = filename.substring(prefix.length());
|
||||
key = key.substring(0, key.length() - suffix.length());
|
||||
Hash h = new Hash();
|
||||
h.fromBase64(key);
|
||||
//Hash h = new Hash();
|
||||
//h.fromBase64(key);
|
||||
byte[] b = Base64.decode(key);
|
||||
if (b == null)
|
||||
return null;
|
||||
Hash h = Hash.create(b);
|
||||
return h;
|
||||
} catch (Exception e) {
|
||||
// static
|
||||
|
||||
@@ -937,11 +937,9 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
RouterAddress addr = _externalAddress;
|
||||
UDPAddress ua = new UDPAddress(addr);
|
||||
int valid = 0;
|
||||
Hash peerHash = new Hash();
|
||||
for (int i = 0; i < ua.getIntroducerCount(); i++) {
|
||||
// warning: this is only valid as long as we use the ident hash as their key.
|
||||
peerHash.setData(ua.getIntroducerKey(i));
|
||||
PeerState peer = getPeerState(peerHash);
|
||||
PeerState peer = getPeerState(Hash.create(ua.getIntroducerKey(i)));
|
||||
if (peer != null)
|
||||
valid++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user