MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / onConnectionError

Method onConnectionError

src/Peer/Peer.py:389–397  ·  view source on GitHub ↗
(self, reason="Unknown")

Source from the content-addressed store, hash-verified

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):

Callers 4

connectMethod · 0.95
requestMethod · 0.95
pingMethod · 0.95
publisherMethod · 0.80

Calls 1

removeMethod · 0.95

Tested by

no test coverage detected