]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Prevent clients from connecting to other clients with the same ID
authorMatt Joiner <anacrolix@gmail.com>
Sun, 16 Nov 2014 19:54:00 +0000 (13:54 -0600)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 16 Nov 2014 19:54:00 +0000 (13:54 -0600)
client.go

index 8c9e64df1aad9b597512648d21b251a5213d8363..e5466e22231b44e5d02f486f42d65e55f80be3fa 100644 (file)
--- a/client.go
+++ b/client.go
@@ -586,6 +586,9 @@ func (me *Client) runConnection(sock net.Conn, torrent *torrent, discovery peerS
        if !ok {
                return
        }
+       if hsRes.peerID == me.peerID {
+               return
+       }
        torrent = me.torrent(hsRes.InfoHash)
        if torrent == nil {
                return