Browse Source
ledger: give clear error that old HW.1 cannot send to bech32 address
maybe related #7022
patch-4
SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
3 additions and
1 deletions
-
electrum/plugins/ledger/ledger.py
|
|
@ -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)) |
|
|
|