diff --git a/basicswap/interface/ltc.py b/basicswap/interface/ltc.py index 192ecba..1938502 100644 --- a/basicswap/interface/ltc.py +++ b/basicswap/interface/ltc.py @@ -26,87 +26,6 @@ class LTCInterface(BTCInterface): wallet=self._rpc_wallet_mweb, ) - def checkWallets(self) -> int: - if self._connection_type == "electrum": - wm = self.getWalletManager() - if wm and wm.isInitialized(self.coin_type()): - return 1 - return 0 - - wallets = self.rpc("listwallets") - - if self._rpc_wallet not in wallets: - self._log.debug( - f"Wallet: {self._rpc_wallet} not active, attempting to load." - ) - try: - self.rpc( - "loadwallet", - [ - self._rpc_wallet, - ], - ) - wallets = self.rpc("listwallets") - except Exception as e: - self._log.debug(f'Error loading wallet "{self._rpc_wallet}": {e}.') - if "does not exist" in str(e) or "Path does not exist" in str(e): - try: - wallet_dirs = self.rpc("listwalletdir") - existing = [w["name"] for w in wallet_dirs.get("wallets", [])] - except Exception: - existing = [] - if len(existing) == 0: - self._log.info( - f'Creating wallet "{self._rpc_wallet}" for {self.coin_name()}.' - ) - try: - # wallet_name, disable_private_keys, blank, passphrase, avoid_reuse, descriptors - self.rpc( - "createwallet", - [ - self._rpc_wallet, - False, - True, - "", - False, - self._use_descriptors, - ], - ) - wallets = self.rpc("listwallets") - if self.getWalletSeedID() == "Not found": - self._log.info( - f"Initializing HD seed for {self.coin_name()}." - ) - self._sc.initialiseWallet(self.coin_type()) - except Exception as create_e: - self._log.error(f"Error creating wallet: {create_e}") - - if self._rpc_wallet not in wallets and len(wallets) > 0: - self._log.warning(f"Changing {self.ticker()} wallet name.") - for wallet_name in wallets: - if wallet_name in ("mweb",): - continue - - change_watchonly_wallet: bool = ( - self._rpc_wallet_watch == self._rpc_wallet - ) - - self._rpc_wallet = wallet_name - self._log.info( - f"Switched {self.ticker()} wallet name to {self._rpc_wallet}." - ) - self.rpc_wallet = make_rpc_func( - self._rpcport, - self._rpcauth, - host=self._rpc_host, - wallet=self._rpc_wallet, - ) - if change_watchonly_wallet: - self.rpc_wallet_watch = self.rpc_wallet - break - - return len(wallets) - def getNewMwebAddress(self, use_segwit=False, label="swap_receive") -> str: if self.useBackend(): raise ValueError("MWEB addresses not supported in electrum mode") diff --git a/tests/basicswap/test_xmr.py b/tests/basicswap/test_xmr.py index b79e8ba..92d5525 100644 --- a/tests/basicswap/test_xmr.py +++ b/tests/basicswap/test_xmr.py @@ -222,6 +222,7 @@ def prepare_swapclient_dir( "datadir": os.path.join(datadir, "ltc_" + str(node_id)), "bindir": cfg.LITECOIN_BINDIR, "use_segwit": True, + "wallet_name": "bsx_wallet", } if cls: