| 355 | self.response({"modified_files": modified_files}) |
| 356 | |
| 357 | def actionGetHashfield(self, params): |
| 358 | site = self.sites.get(params["site"]) |
| 359 | if not site or not site.isServing(): # Site unknown or not serving |
| 360 | self.response({"error": "Unknown site"}) |
| 361 | self.connection.badAction(5) |
| 362 | return False |
| 363 | |
| 364 | # Add peer to site if not added before |
| 365 | peer = site.addPeer(self.connection.ip, self.connection.port, return_peer=True, source="request") |
| 366 | if not peer.connection: # Just added |
| 367 | peer.connect(self.connection) # Assign current connection to peer |
| 368 | |
| 369 | peer.time_my_hashfield_sent = time.time() # Don't send again if not changed |
| 370 | |
| 371 | self.response({"hashfield_raw": site.content_manager.hashfield.tobytes()}) |
| 372 | |
| 373 | def findHashIds(self, site, hash_ids, limit=100): |
| 374 | back = collections.defaultdict(lambda: collections.defaultdict(list)) |