From: Matt Joiner <anacrolix@gmail.com>
Date: Tue, 19 Oct 2021 02:37:18 +0000 (+1100)
Subject: Ending a conn because we don't like its ID is not an error
X-Git-Tag: v1.34.0~2
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=58cc0f3d872bab2dbe1a08ef818837602623ff98;p=btrtrc.git

Ending a conn because we don't like its ID is not an error

(cherry picked from commit 2a5ba846cef9b4e035b3b88698f3e7f7d9d79251)
---

diff --git a/client.go b/client.go
index 3aa3ad25..c55eb1a7 100644
--- a/client.go
+++ b/client.go
@@ -935,7 +935,8 @@ func (cl *Client) runHandshookConn(c *PeerConn, t *Torrent) error {
 			// address, we won't record the remote address as a doppleganger. Instead, the initiator
 			// can record *us* as the doppleganger.
 		} */
-		return errors.New("local and remote peer ids are the same")
+		t.logger.WithLevel(log.Debug).Printf("local and remote peer ids are the same")
+		return nil
 	}
 	c.conn.SetWriteDeadline(time.Time{})
 	c.r = deadlineReader{c.conn, c.r}