Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename simcall process_change_host -> process_set_host
[simgrid.git] / examples / java / bittorrent / Peer.java
index 10fd6c5..569e8b8 100644 (file)
@@ -201,7 +201,7 @@ public class Peer extends Process {
                                }
                        }                       
                }
-               this.hostname = host.getName();
+               this.hostname = getHost().getName();
        }
        /**
         * Retrieves the peer list from the tracker
@@ -419,10 +419,9 @@ public class Peer extends Process {
                        return;
                }
                if (true || pieces < 3) {
-                       int i = 0, peerPiece;
+                       int peerPiece;
                        do {
                                currentPiece = stream.randInt(0,Common.FILE_PIECES - 1);
-                               i++;
                        } while (!(bitfield[currentPiece] == '0' && !currentPieces.contains(currentPiece)));
                }
                else {