async def _stop_wallet(self, path: str) -> bool:
        """Returns True iff a wallet was found."""
        path = standardize_path(path)
        wallet_key = self._wallet_key_from_path(path)
        wallet = self._wallets.pop(wallet_key, None)
        if not wallet:
            return False
        await wallet.stop()
        if self.config.get('wallet_path') is None:
            wallet_paths = [w.db.storage.path for w in self._wallets.values()
                            if w.db.storage and w.db.storage.path]
            if self.config.CURRENT_WALLET == path and wallet_paths:
                self.config.CURRENT_WALLET = wallet_paths[0]
        return True
Returns True iff a wallet was found.
electrum/daemon.py