mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
ledger: mention "bitcoin" app when update is needed
This commit is contained in:
parent
cf82b1d9d5
commit
d76f36df70
1 changed files with 23 additions and 17 deletions
|
@ -25,6 +25,12 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
BTCHIP = False
|
BTCHIP = False
|
||||||
|
|
||||||
|
MSG_NEEDS_FW_UPDATE_GENERIC = _('Firmware version too old. Please update at') + \
|
||||||
|
' https://www.ledgerwallet.com'
|
||||||
|
MSG_NEEDS_FW_UPDATE_SEGWIT = _('Firmware version (or "Bitcoin" app) too old for Segwit support. Please update at') + \
|
||||||
|
' https://www.ledgerwallet.com'
|
||||||
|
|
||||||
|
|
||||||
class Ledger_Client():
|
class Ledger_Client():
|
||||||
def __init__(self, hidDevice):
|
def __init__(self, hidDevice):
|
||||||
self.dongleObject = btchip(hidDevice)
|
self.dongleObject = btchip(hidDevice)
|
||||||
|
@ -72,9 +78,9 @@ class Ledger_Client():
|
||||||
#self.get_client() # prompt for the PIN before displaying the dialog if necessary
|
#self.get_client() # prompt for the PIN before displaying the dialog if necessary
|
||||||
#self.handler.show_message("Computing master public key")
|
#self.handler.show_message("Computing master public key")
|
||||||
if xtype in ['p2wpkh', 'p2wsh'] and not self.supports_native_segwit():
|
if xtype in ['p2wpkh', 'p2wsh'] and not self.supports_native_segwit():
|
||||||
raise Exception("Firmware version too old for Segwit support. Please update at https://www.ledgerwallet.com")
|
raise Exception(MSG_NEEDS_FW_UPDATE_SEGWIT)
|
||||||
if xtype in ['p2wpkh-p2sh', 'p2wsh-p2sh'] and not self.supports_segwit():
|
if xtype in ['p2wpkh-p2sh', 'p2wsh-p2sh'] and not self.supports_segwit():
|
||||||
raise Exception("Firmware version too old for Segwit support. Please update at https://www.ledgerwallet.com")
|
raise Exception(MSG_NEEDS_FW_UPDATE_SEGWIT)
|
||||||
splitPath = bip32_path.split('/')
|
splitPath = bip32_path.split('/')
|
||||||
if splitPath[0] == 'm':
|
if splitPath[0] == 'm':
|
||||||
splitPath = splitPath[1:]
|
splitPath = splitPath[1:]
|
||||||
|
@ -134,7 +140,7 @@ class Ledger_Client():
|
||||||
|
|
||||||
if not checkFirmware(firmware):
|
if not checkFirmware(firmware):
|
||||||
self.dongleObject.dongle.close()
|
self.dongleObject.dongle.close()
|
||||||
raise Exception("HW1 firmware version too old. Please update at https://www.ledgerwallet.com")
|
raise Exception(MSG_NEEDS_FW_UPDATE_GENERIC)
|
||||||
try:
|
try:
|
||||||
self.dongleObject.getOperationMode()
|
self.dongleObject.getOperationMode()
|
||||||
except BTChipException as e:
|
except BTChipException as e:
|
||||||
|
@ -300,12 +306,12 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||||
|
|
||||||
if txin['type'] in ['p2wpkh-p2sh', 'p2wsh-p2sh']:
|
if txin['type'] in ['p2wpkh-p2sh', 'p2wsh-p2sh']:
|
||||||
if not self.get_client_electrum().supports_segwit():
|
if not self.get_client_electrum().supports_segwit():
|
||||||
self.give_error("Firmware version too old to support segwit. Please update at https://www.ledgerwallet.com")
|
self.give_error(MSG_NEEDS_FW_UPDATE_SEGWIT)
|
||||||
segwitTransaction = True
|
segwitTransaction = True
|
||||||
|
|
||||||
if txin['type'] in ['p2wpkh', 'p2wsh']:
|
if txin['type'] in ['p2wpkh', 'p2wsh']:
|
||||||
if not self.get_client_electrum().supports_native_segwit():
|
if not self.get_client_electrum().supports_native_segwit():
|
||||||
self.give_error("Firmware version too old to support native segwit. Please update at https://www.ledgerwallet.com")
|
self.give_error(MSG_NEEDS_FW_UPDATE_SEGWIT)
|
||||||
segwitTransaction = True
|
segwitTransaction = True
|
||||||
|
|
||||||
pubkeys, x_pubkeys = tx.get_sorted_pubkeys(txin)
|
pubkeys, x_pubkeys = tx.get_sorted_pubkeys(txin)
|
||||||
|
|
Loading…
Add table
Reference in a new issue