MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / remove

Method remove

src/Peer/Peer.py:375–384  ·  view source on GitHub ↗
(self, reason="Removing")

Source from the content-addressed store, hash-verified

373
374 # Stop and remove from site
375 def remove(self, reason="Removing"):
376 self.log("Removing peer...Connection error: %s, Hash failed: %s" % (self.connection_error, self.hash_failed))
377 if self.site and self.key in self.site.peers:
378 del(self.site.peers[self.key])
379
380 if self.site and self in self.site.peers_recent:
381 self.site.peers_recent.remove(self)
382
383 if self.connection:
384 self.connection.close(reason)
385
386 # - EVENTS -
387

Callers 15

peerPingMethod · 0.95
onConnectionErrorMethod · 0.95
announceTrackerZeroMethod · 0.95
startFunction · 0.80
routeMethod · 0.80
actionSiteAddMethod · 0.80
actionWebsocketMethod · 0.80
all.jsFile · 0.80
ctFunction · 0.80
00-jquery.min.jsFile · 0.80

Calls 2

logMethod · 0.95
closeMethod · 0.45

Tested by 4

testPingMethod · 0.64
testSignOptionalFilesMethod · 0.64
testFindOptionalMethod · 0.64
testUpdateMethod · 0.64