diff --git a/magneticod/magneticod/__main__.py b/magneticod/magneticod/__main__.py index 0d412ae..bd075c9 100644 --- a/magneticod/magneticod/__main__.py +++ b/magneticod/magneticod/__main__.py @@ -61,7 +61,7 @@ def main(): database.close() watch_q_task.cancel() loop.run_until_complete(node.shutdown()) - loop.run_until_complete(watch_q_task) + loop.run_until_complete(asyncio.wait([watch_q_task])) return 0 diff --git a/magneticod/magneticod/dht.py b/magneticod/magneticod/dht.py index 91cbe4a..6b85446 100644 --- a/magneticod/magneticod/dht.py +++ b/magneticod/magneticod/dht.py @@ -62,6 +62,9 @@ class SybilNode: self._tasks.append(self._loop.create_task(self.increase_neighbour_task())) self._transport = transport + def connection_lost(self, exc): + self._is_paused = True + def pause_writing(self): self._is_paused = True