diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 581c4fc..ac59cea 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -1651,11 +1651,14 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): for c in check_coins: ci = self.ci(c) if self._restrict_unknown_seed_wallets and not ci.knownWalletSeed(): - raise ValueError( - '{} has an unexpected wallet seed and "restrict_unknown_seed_wallets" is enabled.'.format( - ci.coin_name() + if not ci._have_checked_seed: + self.checkWalletSeed(c) + if not ci.knownWalletSeed(): + raise ValueError( + '{} has an unexpected wallet seed and "restrict_unknown_seed_wallets" is enabled.'.format( + ci.coin_name() + ) ) - ) if self.coin_clients[c]["connection_type"] not in ("rpc", "electrum"): continue if c in (Coins.XMR, Coins.WOW): @@ -13896,7 +13899,11 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): "unconfirmed": ci.format_amount( walletinfo["unconfirmed_balance"], conv_int=True ), - "expected_seed": ci.knownWalletSeed(), + "expected_seed": ( + ci.knownWalletSeed() + if ci._have_checked_seed + else self.checkWalletSeed(coin) + ), "encrypted": walletinfo["encrypted"], "locked": walletinfo["locked"], "connection_type": self.coin_clients[coin].get( diff --git a/basicswap/interface/xmr.py b/basicswap/interface/xmr.py index 1b34be2..7517777 100644 --- a/basicswap/interface/xmr.py +++ b/basicswap/interface/xmr.py @@ -257,6 +257,7 @@ class XMRInterface(CoinInterface): ) raise os.rename(walletpath, bkp_path) + self._have_checked_seed = False # Drop through to open_wallet else: raise diff --git a/basicswap/wallet_backend.py b/basicswap/wallet_backend.py index feda902..f876b50 100644 --- a/basicswap/wallet_backend.py +++ b/basicswap/wallet_backend.py @@ -810,7 +810,9 @@ class ElectrumBackend(WalletBackend): now = time.time() stale_threshold = 300 - is_synced = height > 0 and (now - height_time) < stale_threshold + last_activity = getattr(self._server, "_last_activity", 0) + most_recent = max(height_time, last_activity) + is_synced = height > 0 and (now - most_recent) < stale_threshold return { "height": height, "synced": is_synced,