| 540 | |
| 541 | @staticmethod |
| 542 | def stopDownloadingObject(hashId, forwardAnyway=False): |
| 543 | for connection in network.connectionpool.BMConnectionPool().inboundConnections.values() + \ |
| 544 | network.connectionpool.BMConnectionPool().outboundConnections.values(): |
| 545 | try: |
| 546 | del connection.objectsNewToMe[hashId] |
| 547 | except KeyError: |
| 548 | pass |
| 549 | if not forwardAnyway: |
| 550 | try: |
| 551 | with connection.objectsNewToThemLock: |
| 552 | del connection.objectsNewToThem[hashId] |
| 553 | except KeyError: |
| 554 | pass |
| 555 | try: |
| 556 | del state.missingObjects[hashId] |
| 557 | except KeyError: |
| 558 | pass |
| 559 | |
| 560 | def handle_close(self): |
| 561 | self.set_state("close") |