mapa17 / Eruliaf

A BitTorrent like overlay peer simulator
GNU General Public License v3.0
1 stars 0 forks source link

Wrong number of total/completed Peers #72

Closed mapa17 closed 12 years ago

mapa17 commented 12 years ago

In the Statistic displaying the number of total and completed peers is wrong. Its displaying double the number of total peers, and peers that leave the simulation still remain in the graph.

mapa17 commented 12 years ago

This is a big bug in the Simulation Itself. Peers do disconnect when they leave the Torrent, but they remain the simulation queue and so generate Statistics and slow down the simulation.

mapa17 commented 12 years ago

The real reason for all of this is that peers are added twice to the tracker, and that the Observer Object is using the peer list of the tracker in order to generate statistics. Peers do are removed from the simulation, but a second copy of them remain in the Tracker that then generates statistics in the Observer.

This has to be because of some error in the new Peer._wakeUpPeer() function and the Peer spawning by the Peer Factory.

mapa17 commented 12 years ago

The error was that the Peer Factory kept adding Peers to the tracker although each peer does this on its own.