don't connect to self

This commit is contained in:
orignal committed 2026-08-24 16:15:40 -04:00
1 parent 465e17a9b9
commit 060a06483b
1 file changed
+5
+5
View File
@@ -1947,6 +1947,11 @@ namespace torrents
{
if (!torrent) return;
LogPrint (eLogDebug, "Torrents: Connecting to peer ", peer.ToBase32 () + ".b32.i2p");
if (peer == GetLocalDestination ()->GetIdentHash ())
{
LogPrint (eLogInfo, "Torrents: Can't connect to self");
return;
}
CreateStream ([this, torrent, peer](std::shared_ptr<i2p::stream::Stream> stream)
{
if (stream)