- Speed up some hashcode() and equals()
- Cleanup and javadoc
This commit is contained in:
@ -64,16 +64,16 @@ public class Address extends DataStructureImpl {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return DataHelper.hashCode(getHostname())
|
||||
+ DataHelper.hashCode(getDestination());
|
||||
return DataHelper.hashCode(_hostname)
|
||||
+ DataHelper.hashCode(_destination);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder(64);
|
||||
buf.append("[Address: ");
|
||||
buf.append("\n\tHostname: ").append(getHostname());
|
||||
buf.append("\n\tDestination: ").append(getDestination());
|
||||
buf.append("\n\tHostname: ").append(_hostname);
|
||||
buf.append("\n\tDestination: ").append(_destination);
|
||||
buf.append("]");
|
||||
return buf.toString();
|
||||
}
|
||||
|
@ -140,11 +140,11 @@ public class Certificate extends DataStructureImpl {
|
||||
public boolean equals(Object object) {
|
||||
if ((object == null) || !(object instanceof Certificate)) return false;
|
||||
Certificate cert = (Certificate) object;
|
||||
return getCertificateType() == cert.getCertificateType() && DataHelper.eq(getPayload(), cert.getPayload());
|
||||
return _type == cert.getCertificateType() && DataHelper.eq(_payload, cert.getPayload());
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getCertificateType() + DataHelper.hashCode(getPayload());
|
||||
return _type + DataHelper.hashCode(_payload);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -129,9 +129,9 @@ public class Destination extends DataStructureImpl {
|
||||
public boolean equals(Object object) {
|
||||
if ((object == null) || !(object instanceof Destination)) return false;
|
||||
Destination dst = (Destination) object;
|
||||
return DataHelper.eq(getCertificate(), dst.getCertificate())
|
||||
&& DataHelper.eq(getSigningPublicKey(), dst.getSigningPublicKey())
|
||||
&& DataHelper.eq(getPublicKey(), dst.getPublicKey());
|
||||
return DataHelper.eq(_certificate, dst.getCertificate())
|
||||
&& DataHelper.eq(_signingKey, dst.getSigningPublicKey())
|
||||
&& DataHelper.eq(_publicKey, dst.getPublicKey());
|
||||
}
|
||||
|
||||
/** the public key has enough randomness in it to use it by itself for speed */
|
||||
|
@ -77,11 +77,13 @@ public class Lease extends DataStructureImpl {
|
||||
* Transient attribute of the lease, used to note how many times messages sent
|
||||
* to the destination through the current lease were successful.
|
||||
*
|
||||
* @deprecated unused
|
||||
*/
|
||||
public int getNumSuccess() {
|
||||
return _numSuccess;
|
||||
}
|
||||
|
||||
/** @deprecated unused */
|
||||
public void setNumSuccess(int num) {
|
||||
_numSuccess = num;
|
||||
}
|
||||
@ -90,11 +92,13 @@ public class Lease extends DataStructureImpl {
|
||||
* Transient attribute of the lease, used to note how many times messages sent
|
||||
* to the destination through the current lease failed.
|
||||
*
|
||||
* @deprecated unused
|
||||
*/
|
||||
public int getNumFailure() {
|
||||
return _numFailure;
|
||||
}
|
||||
|
||||
/** @deprecated unused */
|
||||
public void setNumFailure(int num) {
|
||||
_numFailure = num;
|
||||
}
|
||||
@ -131,25 +135,25 @@ public class Lease extends DataStructureImpl {
|
||||
public boolean equals(Object object) {
|
||||
if ((object == null) || !(object instanceof Lease)) return false;
|
||||
Lease lse = (Lease) object;
|
||||
return DataHelper.eq(getEndDate(), lse.getEndDate())
|
||||
&& DataHelper.eq(getTunnelId(), lse.getTunnelId())
|
||||
&& DataHelper.eq(getGateway(), lse.getGateway());
|
||||
return DataHelper.eq(_end, lse.getEndDate())
|
||||
&& DataHelper.eq(_tunnelId, lse.getTunnelId())
|
||||
&& DataHelper.eq(_gateway, lse.getGateway());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return DataHelper.hashCode(getEndDate()) + DataHelper.hashCode(getGateway())
|
||||
+ DataHelper.hashCode(getTunnelId());
|
||||
return DataHelper.hashCode(_end) + DataHelper.hashCode(_gateway)
|
||||
+ DataHelper.hashCode(_tunnelId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
buf.append("[Lease: ");
|
||||
buf.append("\n\tEnd Date: ").append(getEndDate());
|
||||
buf.append("\n\tGateway: ").append(getGateway());
|
||||
buf.append("\n\tTunnelId: ").append(getTunnelId());
|
||||
buf.append("\n\tEnd Date: ").append(_end);
|
||||
buf.append("\n\tGateway: ").append(_gateway);
|
||||
buf.append("\n\tTunnelId: ").append(_tunnelId);
|
||||
buf.append("]");
|
||||
return buf.toString();
|
||||
}
|
||||
|
@ -46,6 +46,13 @@ import net.i2p.util.RandomSource;
|
||||
* writeBytes() will output the original encrypted
|
||||
* leases and the original leaseset signature.
|
||||
*
|
||||
* Revocation (zero leases) isn't used anywhere. In addition:
|
||||
* - A revoked leaseset has an EarliestLeaseDate of -1, so it will
|
||||
* never be stored successfully.
|
||||
* - Revocation of an encrypted leaseset will explode.
|
||||
* - So having an included signature at all is pointless?
|
||||
*
|
||||
*
|
||||
* @author jrandom
|
||||
*/
|
||||
public class LeaseSet extends DataStructureImpl {
|
||||
@ -54,7 +61,7 @@ public class LeaseSet extends DataStructureImpl {
|
||||
private PublicKey _encryptionKey;
|
||||
private SigningPublicKey _signingKey;
|
||||
// Keep leases in the order received, or else signature verification will fail!
|
||||
private List _leases;
|
||||
private List<Lease> _leases;
|
||||
private Signature _signature;
|
||||
private volatile Hash _currentRoutingKey;
|
||||
private volatile byte[] _routingKeyGenMod;
|
||||
@ -62,7 +69,7 @@ public class LeaseSet extends DataStructureImpl {
|
||||
// Store these since isCurrent() and getEarliestLeaseDate() are called frequently
|
||||
private long _firstExpiration;
|
||||
private long _lastExpiration;
|
||||
private List _decryptedLeases;
|
||||
private List<Lease> _decryptedLeases;
|
||||
private boolean _decrypted;
|
||||
private boolean _checked;
|
||||
|
||||
@ -75,7 +82,7 @@ public class LeaseSet extends DataStructureImpl {
|
||||
setSigningKey(null);
|
||||
setSignature(null);
|
||||
setRoutingKey(null);
|
||||
_leases = new ArrayList();
|
||||
_leases = new ArrayList(MAX_LEASES);
|
||||
_routingKeyGenMod = null;
|
||||
_receivedAsPublished = false;
|
||||
_firstExpiration = Long.MAX_VALUE;
|
||||
@ -100,6 +107,7 @@ public class LeaseSet extends DataStructureImpl {
|
||||
_encryptionKey = encryptionKey;
|
||||
}
|
||||
|
||||
/** @deprecated unused */
|
||||
public SigningPublicKey getSigningKey() {
|
||||
return _signingKey;
|
||||
}
|
||||
@ -130,6 +138,10 @@ public class LeaseSet extends DataStructureImpl {
|
||||
_lastExpiration = expire;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 0-6
|
||||
* A LeaseSet with no leases is revoked.
|
||||
*/
|
||||
public int getLeaseCount() {
|
||||
if (isEncrypted())
|
||||
return _leases.size() - 1;
|
||||
@ -208,6 +220,7 @@ public class LeaseSet extends DataStructureImpl {
|
||||
|
||||
/**
|
||||
* Verify that the signature matches the lease set's destination's signing public key.
|
||||
* OR the included revocation key.
|
||||
*
|
||||
* @return true only if the signature matches
|
||||
*/
|
||||
@ -216,17 +229,18 @@ public class LeaseSet extends DataStructureImpl {
|
||||
if (getDestination() == null) return false;
|
||||
byte data[] = getBytes();
|
||||
if (data == null) return false;
|
||||
boolean signedByDest = DSAEngine.getInstance().verifySignature(getSignature(), data,
|
||||
getDestination().getSigningPublicKey());
|
||||
boolean signedByDest = DSAEngine.getInstance().verifySignature(_signature, data,
|
||||
_destination.getSigningPublicKey());
|
||||
boolean signedByRevoker = false;
|
||||
if (!signedByDest) {
|
||||
signedByRevoker = DSAEngine.getInstance().verifySignature(getSignature(), data, _signingKey);
|
||||
signedByRevoker = DSAEngine.getInstance().verifySignature(_signature, data, _signingKey);
|
||||
}
|
||||
return signedByDest || signedByRevoker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that the signature matches the lease set's destination's signing public key.
|
||||
* OR the specified revocation key.
|
||||
*
|
||||
* @return true only if the signature matches
|
||||
*/
|
||||
@ -235,11 +249,11 @@ public class LeaseSet extends DataStructureImpl {
|
||||
if (getDestination() == null) return false;
|
||||
byte data[] = getBytes();
|
||||
if (data == null) return false;
|
||||
boolean signedByDest = DSAEngine.getInstance().verifySignature(getSignature(), data,
|
||||
getDestination().getSigningPublicKey());
|
||||
boolean signedByDest = DSAEngine.getInstance().verifySignature(_signature, data,
|
||||
_destination.getSigningPublicKey());
|
||||
boolean signedByRevoker = false;
|
||||
if (!signedByDest) {
|
||||
signedByRevoker = DSAEngine.getInstance().verifySignature(getSignature(), data, signingKey);
|
||||
signedByRevoker = DSAEngine.getInstance().verifySignature(_signature, data, signingKey);
|
||||
}
|
||||
return signedByDest || signedByRevoker;
|
||||
}
|
||||
@ -339,9 +353,9 @@ public class LeaseSet extends DataStructureImpl {
|
||||
LeaseSet ls = (LeaseSet) object;
|
||||
return DataHelper.eq(getEncryptionKey(), ls.getEncryptionKey()) &&
|
||||
//DataHelper.eq(getVersion(), ls.getVersion()) &&
|
||||
DataHelper.eq(_leases, ls._leases) && DataHelper.eq(getSignature(), ls.getSignature())
|
||||
&& DataHelper.eq(getSigningKey(), ls.getSigningKey())
|
||||
&& DataHelper.eq(getDestination(), ls.getDestination());
|
||||
DataHelper.eq(_leases, ls._leases) && DataHelper.eq(_signature, ls.getSignature())
|
||||
&& DataHelper.eq(_signingKey, ls.getSigningKey())
|
||||
&& DataHelper.eq(_destination, ls.getDestination());
|
||||
|
||||
}
|
||||
|
||||
@ -357,11 +371,11 @@ public class LeaseSet extends DataStructureImpl {
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
buf.append("[LeaseSet: ");
|
||||
buf.append("\n\tDestination: ").append(getDestination());
|
||||
buf.append("\n\tEncryptionKey: ").append(getEncryptionKey());
|
||||
buf.append("\n\tSigningKey: ").append(getSigningKey());
|
||||
buf.append("\n\tDestination: ").append(_destination);
|
||||
buf.append("\n\tEncryptionKey: ").append(_encryptionKey);
|
||||
buf.append("\n\tSigningKey: ").append(_signingKey);
|
||||
//buf.append("\n\tVersion: ").append(getVersion());
|
||||
buf.append("\n\tSignature: ").append(getSignature());
|
||||
buf.append("\n\tSignature: ").append(_signature);
|
||||
buf.append("\n\tLeases: #").append(getLeaseCount());
|
||||
for (int i = 0; i < getLeaseCount(); i++)
|
||||
buf.append("\n\t\tLease (").append(i).append("): ").append(getLease(i));
|
||||
|
@ -96,13 +96,13 @@ public class Payload extends DataStructureImpl {
|
||||
public boolean equals(Object object) {
|
||||
if ((object == null) || !(object instanceof Payload)) return false;
|
||||
Payload p = (Payload) object;
|
||||
return DataHelper.eq(getUnencryptedData(), p.getUnencryptedData())
|
||||
&& DataHelper.eq(getEncryptedData(), p.getEncryptedData());
|
||||
return DataHelper.eq(_unencryptedData, p.getUnencryptedData())
|
||||
&& DataHelper.eq(_encryptedData, p.getEncryptedData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return DataHelper.hashCode(getUnencryptedData());
|
||||
return DataHelper.hashCode(_unencryptedData);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -110,11 +110,11 @@ public class Payload extends DataStructureImpl {
|
||||
if (true) return "[Payload]";
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
buf.append("[Payload: ");
|
||||
if (getUnencryptedData() != null)
|
||||
buf.append("\n\tData: ").append(DataHelper.toString(getUnencryptedData(), 16));
|
||||
if (_unencryptedData != null)
|
||||
buf.append("\n\tData: ").append(DataHelper.toString(_unencryptedData, 16));
|
||||
else
|
||||
buf.append("\n\tData: *encrypted* = [").append(DataHelper.toString(getEncryptedData(), 16)).append("]");
|
||||
buf.append("\n\tData: *encrypted* = [").append(DataHelper.toString(_encryptedData, 16)).append("]");
|
||||
buf.append("]");
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,15 +122,15 @@ public class RouterAddress extends DataStructureImpl {
|
||||
public boolean equals(Object object) {
|
||||
if ((object == null) || !(object instanceof RouterAddress)) return false;
|
||||
RouterAddress addr = (RouterAddress) object;
|
||||
return DataHelper.eq(getCost(), addr.getCost()) && DataHelper.eq(getExpiration(), addr.getExpiration())
|
||||
&& DataHelper.eq(getOptions(), addr.getOptions())
|
||||
&& DataHelper.eq(getTransportStyle(), addr.getTransportStyle());
|
||||
return DataHelper.eq(_cost, addr.getCost()) && DataHelper.eq(_expiration, addr.getExpiration())
|
||||
&& DataHelper.eq(_options, addr.getOptions())
|
||||
&& DataHelper.eq(_transportStyle, addr.getTransportStyle());
|
||||
}
|
||||
|
||||
/** the style should be sufficient, for speed */
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return DataHelper.hashCode(getTransportStyle());
|
||||
return DataHelper.hashCode(_transportStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -96,9 +96,9 @@ public class RouterIdentity extends DataStructureImpl {
|
||||
public boolean equals(Object object) {
|
||||
if ((object == null) || !(object instanceof RouterIdentity)) return false;
|
||||
RouterIdentity ident = (RouterIdentity) object;
|
||||
return DataHelper.eq(getCertificate(), ident.getCertificate())
|
||||
&& DataHelper.eq(getSigningPublicKey(), ident.getSigningPublicKey())
|
||||
&& DataHelper.eq(getPublicKey(), ident.getPublicKey());
|
||||
return DataHelper.eq(_certificate, ident.getCertificate())
|
||||
&& DataHelper.eq(_signingKey, ident.getSigningPublicKey())
|
||||
&& DataHelper.eq(_publicKey, ident.getPublicKey());
|
||||
}
|
||||
|
||||
/** the public key has enough randomness in it to use it by itself for speed */
|
||||
|
@ -37,8 +37,8 @@ public class RouterInfo extends DataStructureImpl {
|
||||
private final static Log _log = new Log(RouterInfo.class);
|
||||
private RouterIdentity _identity;
|
||||
private volatile long _published;
|
||||
private final Set _addresses;
|
||||
private final Set _peers;
|
||||
private final Set<RouterAddress> _addresses;
|
||||
private final Set<Hash> _peers;
|
||||
private /* FIXME final FIXME */ Properties _options;
|
||||
private volatile Signature _signature;
|
||||
private volatile Hash _currentRoutingKey;
|
||||
@ -61,8 +61,8 @@ public class RouterInfo extends DataStructureImpl {
|
||||
public RouterInfo() {
|
||||
setIdentity(null);
|
||||
setPublished(0);
|
||||
_addresses = new HashSet();
|
||||
_peers = new HashSet();
|
||||
_addresses = new HashSet(2);
|
||||
_peers = new HashSet(0);
|
||||
_options = new OrderedProperties();
|
||||
setSignature(null);
|
||||
_validated = false;
|
||||
@ -132,7 +132,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
* router can be contacted.
|
||||
*
|
||||
*/
|
||||
public Set getAddresses() {
|
||||
public Set<RouterAddress> getAddresses() {
|
||||
synchronized (_addresses) {
|
||||
return new HashSet(_addresses);
|
||||
}
|
||||
@ -143,7 +143,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
* can be contacted.
|
||||
*
|
||||
*/
|
||||
public void setAddresses(Set addresses) {
|
||||
public void setAddresses(Set<RouterAddress> addresses) {
|
||||
synchronized (_addresses) {
|
||||
_addresses.clear();
|
||||
if (addresses != null) _addresses.addAll(addresses);
|
||||
@ -152,20 +152,22 @@ public class RouterInfo extends DataStructureImpl {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a set of SHA-256 hashes of RouterIdentities from rotuers
|
||||
* Retrieve a set of SHA-256 hashes of RouterIdentities from routers
|
||||
* this router can be reached through.
|
||||
*
|
||||
* @deprecated Implemented here but unused elsewhere
|
||||
*/
|
||||
public Set getPeers() {
|
||||
public Set<Hash> getPeers() {
|
||||
return _peers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a set of SHA-256 hashes of RouterIdentities from rotuers
|
||||
* Specify a set of SHA-256 hashes of RouterIdentities from routers
|
||||
* this router can be reached through.
|
||||
*
|
||||
* @deprecated Implemented here but unused elsewhere
|
||||
*/
|
||||
public void setPeers(Set peers) {
|
||||
public void setPeers(Set<Hash> peers) {
|
||||
synchronized (_peers) {
|
||||
_peers.clear();
|
||||
if (peers != null) _peers.addAll(peers);
|
||||
@ -277,6 +279,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
// answer: they're always empty... they're a placeholder for one particular
|
||||
// method of trusted links, which isn't implemented in the router
|
||||
// at the moment, and may not be later.
|
||||
// fixme to reduce objects - if (_peers == null) write 0
|
||||
DataHelper.writeLong(out, 1, _peers.size());
|
||||
List peers = DataHelper.sortStructures(_peers);
|
||||
for (Iterator iter = peers.iterator(); iter.hasNext();) {
|
||||
@ -401,7 +404,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
RoutingKeyGenerator gen = RoutingKeyGenerator.getInstance();
|
||||
if ((gen.getModData() == null) || (_routingKeyGenMod == null)
|
||||
|| (!DataHelper.eq(gen.getModData(), _routingKeyGenMod))) {
|
||||
setRoutingKey(gen.getRoutingKey(getIdentity().getHash()));
|
||||
setRoutingKey(gen.getRoutingKey(_identity.getHash()));
|
||||
_routingKeyGenMod = gen.getModData();
|
||||
}
|
||||
return _currentRoutingKey;
|
||||
@ -412,7 +415,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
}
|
||||
|
||||
public boolean validateRoutingKey() {
|
||||
Hash identKey = getIdentity().getHash();
|
||||
Hash identKey = _identity.getHash();
|
||||
Hash rk = RoutingKeyGenerator.getInstance().getRoutingKey(identKey);
|
||||
if (rk.equals(getRoutingKey()))
|
||||
return true;
|
||||
@ -430,7 +433,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
*/
|
||||
public boolean isCurrent(long maxAgeMs) {
|
||||
long earliestExpire = Clock.getInstance().now() - maxAgeMs;
|
||||
if (getPublished() < earliestExpire)
|
||||
if (_published < earliestExpire)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -550,7 +553,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
RouterInfo info = (RouterInfo) object;
|
||||
return DataHelper.eq(_identity, info.getIdentity())
|
||||
&& DataHelper.eq(_signature, info.getSignature())
|
||||
&& DataHelper.eq(getPublished(), info.getPublished())
|
||||
&& DataHelper.eq(_published, info.getPublished())
|
||||
&& DataHelper.eq(_addresses, info.getAddresses())
|
||||
&& DataHelper.eq(_options, info.getOptions())
|
||||
&& DataHelper.eq(_peers, info.getPeers());
|
||||
@ -559,7 +562,7 @@ public class RouterInfo extends DataStructureImpl {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if (!_hashCodeInitialized) {
|
||||
_hashCode = DataHelper.hashCode(_identity) + (int) getPublished();
|
||||
_hashCode = DataHelper.hashCode(_identity) + (int) _published;
|
||||
_hashCodeInitialized = true;
|
||||
}
|
||||
return _hashCode;
|
||||
@ -570,9 +573,9 @@ public class RouterInfo extends DataStructureImpl {
|
||||
if (_stringified != null) return _stringified;
|
||||
StringBuilder buf = new StringBuilder(5*1024);
|
||||
buf.append("[RouterInfo: ");
|
||||
buf.append("\n\tIdentity: ").append(getIdentity());
|
||||
buf.append("\n\tSignature: ").append(getSignature());
|
||||
buf.append("\n\tPublished on: ").append(new Date(getPublished()));
|
||||
buf.append("\n\tIdentity: ").append(_identity);
|
||||
buf.append("\n\tSignature: ").append(_signature);
|
||||
buf.append("\n\tPublished on: ").append(new Date(_published));
|
||||
Set addresses = _addresses; // getAddresses()
|
||||
buf.append("\n\tAddresses: #: ").append(addresses.size());
|
||||
for (Iterator iter = addresses.iterator(); iter.hasNext();) {
|
||||
|
@ -83,14 +83,14 @@ public class TunnelId extends DataStructureImpl {
|
||||
public boolean equals(Object obj) {
|
||||
if ( (obj == null) || !(obj instanceof TunnelId))
|
||||
return false;
|
||||
return getTunnelId() == ((TunnelId)obj).getTunnelId();
|
||||
return _tunnelId == ((TunnelId)obj).getTunnelId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int)getTunnelId();
|
||||
return (int)_tunnelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() { return String.valueOf(getTunnelId()); }
|
||||
public String toString() { return String.valueOf(_tunnelId); }
|
||||
}
|
||||
|
13
history.txt
13
history.txt
@ -1,3 +1,16 @@
|
||||
2010-01-29 zzz
|
||||
* build.xml: Add a debian-source target
|
||||
* Data structures:
|
||||
- Speed up some hashcode() and equals()
|
||||
- Cleanup and javadoc
|
||||
* Jetty: Turn on checkAliases
|
||||
* NetDb:
|
||||
- Add basic DOS prevention for lookups
|
||||
- Move flood throttle check so we don't throttle ourselves
|
||||
- Don't store over client tunnels to pre-0.7.10 floodfills
|
||||
- Don't update unused lease fail stats
|
||||
* Startup: Disable browser launch for debian daemon
|
||||
|
||||
2010-01-28 welterde
|
||||
* enhance support for multiple RouterAddresses' of the same style in RouterInfo
|
||||
|
||||
|
@ -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 = 3;
|
||||
public final static long BUILD = 4;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
@ -56,7 +56,8 @@ public class CreateRouterInfoJob extends JobImpl {
|
||||
stats.setProperty(RouterInfo.PROP_NETWORK_ID, Router.NETWORK_ID+"");
|
||||
getContext().router().addCapabilities(info);
|
||||
info.setOptions(stats);
|
||||
info.setPeers(new HashSet());
|
||||
// not necessary, in constructor
|
||||
//info.setPeers(new HashSet());
|
||||
info.setPublished(getCurrentPublishDate(getContext()));
|
||||
RouterIdentity ident = new RouterIdentity();
|
||||
Certificate cert = getContext().router().createCertificate();
|
||||
|
@ -92,8 +92,9 @@ public class RouterGenerator {
|
||||
RouterInfo info = new RouterInfo();
|
||||
try {
|
||||
info.setAddresses(createAddresses(num));
|
||||
info.setOptions(new Properties());
|
||||
info.setPeers(new HashSet());
|
||||
// not necessary, in constructor
|
||||
//info.setOptions(new Properties());
|
||||
//info.setPeers(new HashSet());
|
||||
info.setPublished(Clock.getInstance().now());
|
||||
RouterIdentity ident = new RouterIdentity();
|
||||
BigInteger bv = new BigInteger(""+num);
|
||||
|
Reference in New Issue
Block a user