(self, reason="Unknown")
| 387 | |
| 388 | # On connection error |
| 389 | def onConnectionError(self, reason="Unknown"): |
| 390 | self.connection_error += 1 |
| 391 | if self.site and len(self.site.peers) > 200: |
| 392 | limit = 3 |
| 393 | else: |
| 394 | limit = 6 |
| 395 | self.reputation -= 1 |
| 396 | if self.connection_error >= limit: # Dead peer |
| 397 | self.remove("Peer connection: %s" % reason) |
| 398 | |
| 399 | # Done working with peer |
| 400 | def onWorkerDone(self): |