mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 17:01:34 +00:00
parent
a61953673a
commit
788b5b04fe
1 changed files with 9 additions and 19 deletions
|
@ -318,7 +318,6 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||||
chipInputs = []
|
chipInputs = []
|
||||||
redeemScripts = []
|
redeemScripts = []
|
||||||
signatures = []
|
signatures = []
|
||||||
preparedTrustedInputs = []
|
|
||||||
changePath = ""
|
changePath = ""
|
||||||
output = None
|
output = None
|
||||||
p2shTransaction = False
|
p2shTransaction = False
|
||||||
|
@ -377,8 +376,8 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||||
self.give_error("P2SH / regular input mixed in same transaction not supported") # should never happen
|
self.give_error("P2SH / regular input mixed in same transaction not supported") # should never happen
|
||||||
|
|
||||||
txOutput = var_int(len(tx.outputs()))
|
txOutput = var_int(len(tx.outputs()))
|
||||||
for txout in tx.outputs():
|
for o in tx.outputs():
|
||||||
output_type, addr, amount = txout
|
output_type, addr, amount = o.type, o.address, o.value
|
||||||
txOutput += int_to_hex(amount, 8)
|
txOutput += int_to_hex(amount, 8)
|
||||||
script = tx.pay_script(output_type, addr)
|
script = tx.pay_script(output_type, addr)
|
||||||
txOutput += var_int(len(script)//2)
|
txOutput += var_int(len(script)//2)
|
||||||
|
@ -442,14 +441,10 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||||
if segwitTransaction:
|
if segwitTransaction:
|
||||||
self.get_client().startUntrustedTransaction(True, inputIndex,
|
self.get_client().startUntrustedTransaction(True, inputIndex,
|
||||||
chipInputs, redeemScripts[inputIndex])
|
chipInputs, redeemScripts[inputIndex])
|
||||||
if changePath:
|
|
||||||
# we don't set meaningful outputAddress, amount and fees
|
# we don't set meaningful outputAddress, amount and fees
|
||||||
# as we only care about the alternateEncoding==True branch
|
# as we only care about the alternateEncoding==True branch
|
||||||
outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx))
|
outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx))
|
||||||
else:
|
|
||||||
outputData = self.get_client().finalizeInputFull(txOutput)
|
|
||||||
outputData['outputData'] = txOutput
|
outputData['outputData'] = txOutput
|
||||||
transactionOutput = outputData['outputData']
|
|
||||||
if outputData['confirmationNeeded']:
|
if outputData['confirmationNeeded']:
|
||||||
outputData['address'] = output
|
outputData['address'] = output
|
||||||
self.handler.finished()
|
self.handler.finished()
|
||||||
|
@ -470,15 +465,10 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||||
while inputIndex < len(inputs):
|
while inputIndex < len(inputs):
|
||||||
self.get_client().startUntrustedTransaction(firstTransaction, inputIndex,
|
self.get_client().startUntrustedTransaction(firstTransaction, inputIndex,
|
||||||
chipInputs, redeemScripts[inputIndex])
|
chipInputs, redeemScripts[inputIndex])
|
||||||
if changePath:
|
|
||||||
# we don't set meaningful outputAddress, amount and fees
|
# we don't set meaningful outputAddress, amount and fees
|
||||||
# as we only care about the alternateEncoding==True branch
|
# as we only care about the alternateEncoding==True branch
|
||||||
outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx))
|
outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx))
|
||||||
else:
|
|
||||||
outputData = self.get_client().finalizeInputFull(txOutput)
|
|
||||||
outputData['outputData'] = txOutput
|
outputData['outputData'] = txOutput
|
||||||
if firstTransaction:
|
|
||||||
transactionOutput = outputData['outputData']
|
|
||||||
if outputData['confirmationNeeded']:
|
if outputData['confirmationNeeded']:
|
||||||
outputData['address'] = output
|
outputData['address'] = output
|
||||||
self.handler.finished()
|
self.handler.finished()
|
||||||
|
|
Loading…
Add table
Reference in a new issue