i2psnark:

- Rework PeerID class so it depends only on peer desthash, since
    peer ID is not available with compact format. Implement deferred
    lookup of destination.
  - Implement compact tracker requests and response handling
    (may not be the final format)
  - Fix Peer hashCode()
  - Java 5
This commit is contained in:
zzz
2010-07-09 16:32:31 +00:00
parent 01ef6baa53
commit c19af4dbcf
7 changed files with 111 additions and 42 deletions

View File

@@ -197,11 +197,14 @@ public class I2PSnarkUtil {
/** connect to the given destination */
I2PSocket connect(PeerID peer) throws IOException {
Hash dest = peer.getAddress().calculateHash();
Destination addr = peer.getAddress();
if (addr == null)
throw new IOException("Null address");
Hash dest = addr.calculateHash();
if (_shitlist.contains(dest))
throw new IOException("Not trying to contact " + dest.toBase64() + ", as they are shitlisted");
try {
I2PSocket rv = _manager.connect(peer.getAddress());
I2PSocket rv = _manager.connect(addr);
if (rv != null)
_shitlist.remove(dest);
return rv;