Fix: Waiting on Electrum Server + re-check the seed after error.

This commit is contained in:
gerlofvanek
2026-04-25 19:45:27 +02:00
parent 0c0fb8360e
commit 0dc5284e51
3 changed files with 16 additions and 6 deletions
+8 -1
View File
@@ -1651,6 +1651,9 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
for c in check_coins:
ci = self.ci(c)
if self._restrict_unknown_seed_wallets and not ci.knownWalletSeed():
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()
@@ -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(
+1
View File
@@ -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
+3 -1
View File
@@ -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,