1
0

bitcoin: disallow importing/sweeping segwit scripts with uncompressed pubkey

fixes #4638
This commit is contained in:
SomberNight
2019-04-19 00:37:28 +02:00
parent a1d98d4331
commit d4a2e9634f
4 changed files with 18 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import sys
import traceback
from electrum import ecc
from electrum.bitcoin import TYPE_ADDRESS, int_to_hex, var_int
from electrum.bitcoin import TYPE_ADDRESS, int_to_hex, var_int, is_segwit_script_type
from electrum.bip32 import BIP32Node
from electrum.i18n import _
from electrum.keystore import Hardware_KeyStore
@@ -518,7 +518,7 @@ class Ledger_KeyStore(Hardware_KeyStore):
client = self.get_client()
address_path = self.get_derivation()[2:] + "/%d/%d"%sequence
self.handler.show_message(_("Showing address ..."))
segwit = Transaction.is_segwit_inputtype(txin_type)
segwit = is_segwit_script_type(txin_type)
segwitNative = txin_type == 'p2wpkh'
try:
client.getWalletPublicKey(address_path, showOnScreen=True, segwit=segwit, segwitNative=segwitNative)