From 1687b17e005a8a02ca94c3a09fa01b6c74c51e2e Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 16 Jun 2025 09:39:50 +0200 Subject: [PATCH] submarine_swaps: wait for unlock if wallet is password protected before starting nostr swap service --- electrum/submarine_swaps.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index dc8a6ab30..b63bf29c1 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -245,6 +245,11 @@ class SwapManager(Logger): @log_exceptions async def run_nostr_server(self): await self.set_nostr_proof_of_work() + + while self.wallet.has_password() and self.wallet.get_unlocked_password() is None: + self.logger.info("This wallet is password-protected. Please unlock it to start the swapserver plugin") + await asyncio.sleep(10) + with NostrTransport(self.config, self, self.lnworker.nostr_keypair) as transport: await transport.is_connected.wait() self.logger.info(f'nostr is connected')