Author: alanmc
Date: 2007-04-01 16:07:34 -0400 (Sun, 01 Apr 2007)
New Revision: 75269

Modified:
   trunk/bitsharp/src/MonoTorrent.Client/Managers/PieceManager.cs
Log:
Bugfix: Flxed fast paths to decide if a peer is interesting or not.

Modified: trunk/bitsharp/src/MonoTorrent.Client/Managers/PieceManager.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent.Client/Managers/PieceManager.cs      
2007-04-01 20:04:15 UTC (rev 75268)
+++ trunk/bitsharp/src/MonoTorrent.Client/Managers/PieceManager.cs      
2007-04-01 20:07:34 UTC (rev 75269)
@@ -73,10 +73,14 @@
         #region Methods
         internal bool IsInteresting(PeerConnectionID id)
         {
-            // If the peer is a seeder, he's only interesting if i have not 
completed the torrent
-            if (id.Peer.IsSeeder)
-                return !this.MyBitField.AllTrue;
+            // If i have completed the torrent, then no-one is interesting
+                       if (id.TorrentManager.Bitfield.AllTrue)
+                               return false;
 
+                       // If the peer is a seeder, then he is definately 
interesting
+                       if (id.Peer.IsSeeder)
+                               return true;
+
             // Otherwise we need to do a full check
             return this.piecePicker.IsInteresting(id);
         }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to