Browse Source

hw wallets: fix "show address" functionality in qt receive tab

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
SomberNight 5 years ago
parent
commit
8cd8c6612d
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 10
      electrum/plugins/hw_wallet/qt.py

10
electrum/plugins/hw_wallet/qt.py

@ -36,6 +36,7 @@ from electrum.gui.qt.util import (read_QIcon, WWLabel, OkButton, WindowModalDial
from electrum.i18n import _ from electrum.i18n import _
from electrum.logging import Logger from electrum.logging import Logger
from electrum.util import parse_URI, InvalidBitcoinURI
from .plugin import OutdatedHwFirmwareException from .plugin import OutdatedHwFirmwareException
@ -255,6 +256,13 @@ class QtPluginBase(object):
receive_address_e = main_window.receive_address_e receive_address_e = main_window.receive_address_e
def show_address(): def show_address():
addr = receive_address_e.text() addr = str(receive_address_e.text())
# note: 'addr' could be ln invoice or BIP21 URI
try:
uri = parse_URI(addr)
except InvalidBitcoinURI:
pass
else:
addr = uri.get('address')
keystore.thread.add(partial(plugin.show_address, wallet, addr, keystore)) keystore.thread.add(partial(plugin.show_address, wallet, addr, keystore))
receive_address_e.addButton("eye1.png", show_address, _("Show on {}").format(plugin.device)) receive_address_e.addButton("eye1.png", show_address, _("Show on {}").format(plugin.device))

Loading…
Cancel
Save