Several connect-to-self checks

This commit is contained in:
zzz
2010-12-20 19:37:38 +00:00
parent ad00c16f85
commit 8451610737
3 changed files with 27 additions and 8 deletions

View File

@ -30,6 +30,7 @@ import java.util.Arrays;
import java.util.List;
import net.i2p.client.streaming.I2PSocket;
import net.i2p.data.DataHelper;
import net.i2p.util.Log;
public class Peer implements Comparable
@ -353,6 +354,9 @@ public class Peer implements Comparable
if (_log.shouldLog(Log.DEBUG))
_log.debug("Read the remote side's hash and peerID fully from " + toString());
if (DataHelper.eq(my_id, bs))
throw new IOException("Connected to myself");
if (options != 0) {
// send them something in runConnection() above
if (_log.shouldLog(Log.DEBUG))