| 170 | self.lastCleared = time.time() |
| 171 | |
| 172 | def delete(self, objectHash=None): |
| 173 | if not hasattr(current_thread(), 'peer'): |
| 174 | return |
| 175 | if objectHash is None: |
| 176 | return |
| 177 | with self.lock: |
| 178 | try: |
| 179 | if objectHash in self.hashes and current_thread().peer in self.hashes[objectHash]['peers']: |
| 180 | self.hashes[objectHash]['sendCount'] += 1 |
| 181 | self.hashes[objectHash]['peers'].remove(current_thread().peer) |
| 182 | except KeyError: |
| 183 | pass |
| 184 | self.clearHashes(objectHash) |
| 185 | |
| 186 | def stop(self): |
| 187 | with self.lock: |