(self, site, hash_ids, limit=100)
| 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)) |
| 375 | found = site.worker_manager.findOptionalHashIds(hash_ids, limit=limit) |
| 376 | |
| 377 | for hash_id, peers in found.items(): |
| 378 | for peer in peers: |
| 379 | ip_type = helper.getIpType(peer.ip) |
| 380 | if len(back[ip_type][hash_id]) < 20: |
| 381 | back[ip_type][hash_id].append(peer.packMyAddress()) |
| 382 | return back |
| 383 | |
| 384 | def actionFindHashIds(self, params): |
| 385 | site = self.sites.get(params["site"]) |
no test coverage detected