diff --git a/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ConnectionManager.cs b/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ConnectionManager.cs index 6505c30c5..1a01baf1c 100644 --- a/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ConnectionManager.cs +++ b/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ConnectionManager.cs @@ -199,6 +199,8 @@ internal async void ProcessNewOutgoingConnection (TorrentManager manager, PeerId try { // Create a handshake message to send to the peer var handshake = new HandshakeMessage (id.ExpectedInfoHash.Truncate (), LocalPeerId, Constants.ProtocolStringV100); + logger.InfoFormatted (id.Connection, "[outgoing] Sending handshake message with peer id '{0}'", LocalPeerId); + var preferredEncryption = EncryptionTypes.GetPreferredEncryption (id.Peer.AllowedEncryption, Settings.AllowedEncryption); if (preferredEncryption.Count == 0) throw new NotSupportedException ("The peer and the engine do not agree on any encryption methods"); @@ -226,6 +228,7 @@ internal async void ProcessNewOutgoingConnection (TorrentManager manager, PeerId try { // Receive their handshake HandshakeMessage handshake = await PeerIO.ReceiveHandshakeAsync (id.Connection, id.Decryptor); + logger.InfoFormatted (id.Connection, "[outgoing] Received handshake message with peer id '{0}'", handshake.PeerId); manager.Mode.HandleMessage (id, handshake, default); } catch { // If we choose plaintext and it resulted in the connection being closed, remove it from the list. diff --git a/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ListenManager.cs b/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ListenManager.cs index 27f209ccf..a830cfd3b 100644 --- a/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ListenManager.cs +++ b/src/MonoTorrent.Client/MonoTorrent.Client/Managers/ListenManager.cs @@ -145,6 +145,9 @@ async ReusableTask HandleHandshake (PeerInfo peerInfo, IPeerConnection con var peer = new Peer (peerInfo, man.InfoHashes.Expand (message.InfoHash)); peer.UpdatePeerId (message.PeerId); + + logger.InfoFormatted (connection, "[incoming] Received handshake with peer_id '{0}'", message.PeerId); + var id = new PeerId (peer, connection, new BitField (man.Bitfield.Length).SetAll (false)) { Decryptor = decryptor, Encryptor = encryptor