ledger: give clear error that old HW.1 cannot send to bech32 address
maybe related #7022
This commit is contained in:
@@ -7,7 +7,7 @@ from typing import Optional, Tuple
|
||||
from electrum import ecc
|
||||
from electrum import bip32
|
||||
from electrum.crypto import hash_160
|
||||
from electrum.bitcoin import int_to_hex, var_int, is_segwit_script_type
|
||||
from electrum.bitcoin import int_to_hex, var_int, is_segwit_script_type, is_b58_address
|
||||
from electrum.bip32 import BIP32Node, convert_bip32_intpath_to_strpath
|
||||
from electrum.i18n import _
|
||||
from electrum.keystore import Hardware_KeyStore
|
||||
@@ -415,6 +415,8 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||
if len(tx.outputs()) > 2:
|
||||
self.give_error("Transaction with more than 2 outputs not supported")
|
||||
for txout in tx.outputs():
|
||||
if client_electrum.is_hw1() and txout.address and not is_b58_address(txout.address):
|
||||
self.give_error(_("This {} device can only send to base58 addresses.").format(self.device))
|
||||
if not txout.address:
|
||||
if client_electrum.is_hw1():
|
||||
self.give_error(_("Only address outputs are supported by {}").format(self.device))
|
||||
|
||||
Reference in New Issue
Block a user