Browse Source
plugins/labels: better error message when using imported wallets
see #6703
patch-4
SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
8 additions and
4 deletions
-
electrum/plugins/labels/labels.py
-
electrum/plugins/labels/qt.py
|
|
@ -176,8 +176,6 @@ class LabelsPlugin(BasePlugin): |
|
|
|
|
|
|
|
def start_wallet(self, wallet: 'Abstract_Wallet'): |
|
|
|
if not wallet.network: return # 'offline' mode |
|
|
|
nonce = self.get_nonce(wallet) |
|
|
|
self.logger.info(f"wallet {wallet.basename()} nonce is {nonce}") |
|
|
|
mpk = wallet.get_fingerprint() |
|
|
|
if not mpk: |
|
|
|
return |
|
|
@ -186,6 +184,8 @@ class LabelsPlugin(BasePlugin): |
|
|
|
iv = hashlib.sha256(password).digest()[:16] |
|
|
|
wallet_id = hashlib.sha256(mpk).hexdigest() |
|
|
|
self.wallets[wallet] = (password, iv, wallet_id) |
|
|
|
nonce = self.get_nonce(wallet) |
|
|
|
self.logger.info(f"wallet {wallet.basename()} nonce is {nonce}") |
|
|
|
# If there is an auth token we can try to actually start syncing |
|
|
|
asyncio.run_coroutine_threadsafe(self.pull_safe_thread(wallet, False), wallet.network.asyncio_loop) |
|
|
|
|
|
|
|
|
|
@ -31,12 +31,16 @@ class Plugin(LabelsPlugin): |
|
|
|
def requires_settings(self): |
|
|
|
return True |
|
|
|
|
|
|
|
def settings_widget(self, window): |
|
|
|
def settings_widget(self, window: WindowModalDialog): |
|
|
|
return EnterButton(_('Settings'), |
|
|
|
partial(self.settings_dialog, window)) |
|
|
|
|
|
|
|
def settings_dialog(self, window): |
|
|
|
def settings_dialog(self, window: WindowModalDialog): |
|
|
|
wallet = window.parent().wallet |
|
|
|
if not wallet.get_fingerprint(): |
|
|
|
window.show_error(_("{} plugin does not support this type of wallet.") |
|
|
|
.format("Label Sync")) |
|
|
|
return |
|
|
|
d = WindowModalDialog(window, _("Label Settings")) |
|
|
|
hbox = QHBoxLayout() |
|
|
|
hbox.addWidget(QLabel("Label sync options:")) |
|
|
|