diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/daemon.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/daemon.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/daemon.py b/packages/meshbay-node/src/meshbay_node/daemon.py index 557b523..46b4ae1 100644 --- a/packages/meshbay-node/src/meshbay_node/daemon.py +++ b/packages/meshbay-node/src/meshbay_node/daemon.py @@ -645,8 +645,15 @@ class NodeDaemon(EnrichmentMixin): log.warning("Invalid revocation token: %s", e) async def on_connected(): + # Back from an unlink: the key was linked again and the hub let + # this node in, so it is serving once more. + if self._state.get("status") == "waiting_for_node_key": + self._state["status"] = "running" await self._sync_blocklist(hub) + def on_unlinked(): + self._state["status"] = "waiting_for_node_key" + ws_task = asyncio.create_task(hub.maintain_ws( on_incoming=on_incoming, on_revocation=on_revocation, @@ -654,6 +661,7 @@ class NodeDaemon(EnrichmentMixin): group_ids=lambda: list((self._state.get("groups_ctx") or {}).keys()), on_connected=on_connected, on_blocklist=self._on_blocklist_update, + on_unlinked=on_unlinked, )) self._tasks.append(ws_task) log.info("Hub WS task started") @@ -1043,7 +1051,7 @@ class NodeDaemon(EnrichmentMixin): self._state["status"] = "waiting_for_node_key" log.warning( "Node key not linked. Get it from `meshbay-node " - "status` and paste it in Settings > Link Node on %s " + "status` and paste it in Profile > Linked nodes on %s " "(the desktop client links it automatically). " "Retrying in %ds...", self._config.hub.url, self.LINK_WAIT_S, |