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

Method found

src/Peer/Peer.py:130–139  ·  view source on GitHub ↗
(self, source="other")

Source from the content-addressed store, hash-verified

128
129 # Found a peer from a source
130 def found(self, source="other"):
131 if self.reputation < 5:
132 if source == "tracker":
133 self.reputation += 1
134 elif source == "local":
135 self.reputation += 3
136
137 if source in ("tracker", "local"):
138 self.site.peers_recent.appendleft(self)
139 self.time_found = time.time()
140
141 # Send a command to peer and return response value
142 def request(self, cmd, params={}, stream_to=None):

Callers 2

addPeerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected