mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 01:11:35 +00:00
follow-up 65eae139af
This commit is contained in:
parent
65eae139af
commit
d8a9c9720a
3 changed files with 17 additions and 8 deletions
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue