1
0

qt wizard bip39 recovery: better handle --offline mode

```
 32.40 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/wizard/wallet.py", line 709, in <lambda>
    button.clicked.connect(lambda: Bip39RecoveryDialog(self, get_account_xpub, on_account_select))
  File "/home/user/wspace/electrum/electrum/gui/qt/bip39_recovery_dialog.py", line 40, in __init__
    fut = asyncio.run_coroutine_threadsafe(coro, network.asyncio_loop)
AttributeError: 'NoneType' object has no attribute 'asyncio_loop'
```
This commit is contained in:
SomberNight
2023-12-01 17:37:58 +00:00
parent 5d178d3a7c
commit 64f82cd260
5 changed files with 26 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ from electrum import Network, keystore
from electrum.bip32 import BIP32Node
from electrum.bip39_recovery import account_discovery
from electrum.logging import get_logger
from electrum.util import get_asyncio_loop
from .util import TaskThread
@@ -84,7 +85,7 @@ class QEBip39RecoveryListModel(QAbstractListModel):
network = Network.get_instance()
coro = account_discovery(network, self.get_account_xpub)
self.state = QEBip39RecoveryListModel.State.Scanning
fut = asyncio.run_coroutine_threadsafe(coro, network.asyncio_loop)
fut = asyncio.run_coroutine_threadsafe(coro, get_asyncio_loop())
self._thread.add(
fut.result,
on_success=self.on_recovery_success,