Skip to content

Commit 96ea80a

Browse files
authored
Merge pull request #9959 from accumulator/nostr_swap_server_wait_unlock
submarine_swaps: wait for unlock if wallet is password protected before starting nostr swap service
2 parents 998e9a5 + 1687b17 commit 96ea80a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

electrum/submarine_swaps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ def start_network(self, network: 'Network'):
245245
@log_exceptions
246246
async def run_nostr_server(self):
247247
await self.set_nostr_proof_of_work()
248+
249+
while self.wallet.has_password() and self.wallet.get_unlocked_password() is None:
250+
self.logger.info("This wallet is password-protected. Please unlock it to start the swapserver plugin")
251+
await asyncio.sleep(10)
252+
248253
with NostrTransport(self.config, self, self.lnworker.nostr_keypair) as transport:
249254
await transport.is_connected.wait()
250255
self.logger.info(f'nostr is connected')

0 commit comments

Comments
 (0)