forked from I2P_Developers/i2p.i2p
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user