From b19edd6771fd898434ca27ae639a87eeab285e99 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Sat, 14 Jun 2025 20:59:19 +0200 Subject: [PATCH] Try and load missing wallets. --- basicswap/interface/btc.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/basicswap/interface/btc.py b/basicswap/interface/btc.py index dc9db8d..0768fd6 100644 --- a/basicswap/interface/btc.py +++ b/basicswap/interface/btc.py @@ -315,6 +315,21 @@ class BTCInterface(Secp256k1Interface): def checkWallets(self) -> int: 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_wallet( + "loadwallet", + [ + self._rpc_wallet, + ], + ) + wallets = self.rpc("listwallets") + except Exception as e: + self._log.debug(f'Error loading wallet "self._rpc_wallet": {e}.') + # Wallet name is "" for some LTC and PART installs on older cores if self._rpc_wallet not in wallets and len(wallets) > 0: self._log.warning(f"Changing {self.ticker()} wallet name.")