Merge pull request #3536 from SomberNight/ledger_needs_fw_upd_msg
ledger: mention "bitcoin" app when update is needed
This commit is contained in:
commit
5c6544a296
|
@ -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)
|
||||||
|
@ -57,9 +63,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:]
|
||||||
|
@ -119,7 +125,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:
|
||||||
|
@ -285,12 +291,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…
Reference in New Issue