mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 12:30:07 +00:00
parent
40e9e8bd63
commit
530980ea37
1 changed files with 12 additions and 6 deletions
|
@ -356,10 +356,17 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
|||
self.give_error("No matching x_key for sign_transaction") # should never happen
|
||||
|
||||
redeemScript = Transaction.get_preimage_script(txin)
|
||||
if txin.get('prev_tx') is None: # and not Transaction.is_segwit_input(txin):
|
||||
# note: offline signing does not work atm even with segwit inputs for ledger
|
||||
raise Exception(_('Offline signing with {} is not supported.').format(self.device))
|
||||
inputs.append([txin['prev_tx'].raw, txin['prevout_n'], redeemScript, txin['prevout_hash'], signingPos, txin.get('sequence', 0xffffffff - 1) ])
|
||||
txin_prev_tx = txin.get('prev_tx')
|
||||
if txin_prev_tx is None and not Transaction.is_segwit_input(txin):
|
||||
raise Exception(_('Offline signing with {} is not supported for legacy inputs.').format(self.device))
|
||||
txin_prev_tx_raw = txin_prev_tx.raw if txin_prev_tx else None
|
||||
inputs.append([txin_prev_tx_raw,
|
||||
txin['prevout_n'],
|
||||
redeemScript,
|
||||
txin['prevout_hash'],
|
||||
signingPos,
|
||||
txin.get('sequence', 0xffffffff - 1),
|
||||
txin.get('value')])
|
||||
inputsPaths.append(hwAddress)
|
||||
pubKeys.append(pubkeys)
|
||||
|
||||
|
@ -401,10 +408,9 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
|||
for utxo in inputs:
|
||||
sequence = int_to_hex(utxo[5], 4)
|
||||
if segwitTransaction:
|
||||
txtmp = bitcoinTransaction(bfh(utxo[0]))
|
||||
tmp = bfh(utxo[3])[::-1]
|
||||
tmp += bfh(int_to_hex(utxo[1], 4))
|
||||
tmp += txtmp.outputs[utxo[1]].amount
|
||||
tmp += bfh(int_to_hex(utxo[6], 8)) # txin['value']
|
||||
chipInputs.append({'value' : tmp, 'witness' : True, 'sequence' : sequence})
|
||||
redeemScripts.append(bfh(utxo[2]))
|
||||
elif not p2shTransaction:
|
||||
|
|
Loading…
Add table
Reference in a new issue