commit 8cd8c6612ded78f55b500d3c0d51e527e27fca4b
parent ff94240139ae2198f4a0e1dadeb47c8f5f9a2604
Author: SomberNight <somber.night@protonmail.com>
Date: Tue, 3 Sep 2019 18:37:48 +0200
hw wallets: fix "show address" functionality in qt receive tab
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/electrum/plugins/hw_wallet/qt.py b/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.logging import Logger
+from electrum.util import parse_URI, InvalidBitcoinURI
from .plugin import OutdatedHwFirmwareException
@@ -255,6 +256,13 @@ class QtPluginBase(object):
receive_address_e = main_window.receive_address_e
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))
receive_address_e.addButton("eye1.png", show_address, _("Show on {}").format(plugin.device))