SomberNight 7 years ago
parent
commit
d8a9c9720a
  1. 8
      lib/transaction.py
  2. 16
      plugins/ledger/ledger.py
  3. 1
      plugins/ledger/qt.py

8
lib/transaction.py

@ -682,8 +682,12 @@ class Transaction:
return value_field + witness
@classmethod
def is_segwit_input(self, txin):
return txin['type'] in ['p2wpkh', 'p2wpkh-p2sh', 'p2wsh', 'p2wsh-p2sh']
def is_segwit_input(cls, txin):
return cls.is_segwit_inputtype(txin['type'])
@classmethod
def is_segwit_inputtype(cls, txin_type):
return txin_type in ('p2wpkh', 'p2wpkh-p2sh', 'p2wsh', 'p2wsh-p2sh')
@classmethod
def input_script(self, txin, estimate_size=False):

16
plugins/ledger/ledger.py

@ -438,15 +438,21 @@ class Ledger_KeyStore(Hardware_KeyStore):
def show_address(self, sequence, txin_type):
self.signing = True
# prompt for the PIN before displaying the dialog if necessary
client = self.get_client()
address_path = self.get_derivation()[2:] + "/%d/%d"%sequence
self.handler.show_message(_("Showing address ..."))
segwit = txin_type in ['p2wpkh', 'p2wsh', 'p2wpkh-p2sh', 'p2wsh-p2sh']
segwit = Transaction.is_segwit_inputtype(txin_type)
try:
self.get_client().getWalletPublicKey(address_path, showOnScreen=True, segwit=segwit)
except:
pass
client.getWalletPublicKey(address_path, showOnScreen=True, segwit=segwit)
except BTChipException as e:
if e.sw == 0x6985: # cancelled by user
pass
else:
traceback.print_exc(file=sys.stderr)
self.handler.show_error(e)
except BaseException as e:
traceback.print_exc(file=sys.stderr)
self.handler.show_error(e)
finally:
self.handler.finished()
self.signing = False

1
plugins/ledger/qt.py

@ -20,7 +20,6 @@ class Plugin(LedgerPlugin, QtPluginBase):
@hook
def receive_menu(self, menu, addrs, wallet):
print('receive_menu')
if type(wallet) is not Standard_Wallet:
return
keystore = wallet.get_keystore()

Loading…
Cancel
Save