From 43272c63a84f28be11aa0a4bc9843f4c280273d0 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 9 Oct 2016 09:20:32 +0200 Subject: [PATCH] fix #1961 --- plugins/ledger/ledger.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/ledger/ledger.py b/plugins/ledger/ledger.py index a0ca7c47e..52436a092 100644 --- a/plugins/ledger/ledger.py +++ b/plugins/ledger/ledger.py @@ -326,11 +326,17 @@ class Ledger_KeyStore(Hardware_KeyStore): # Sign all inputs firstTransaction = True inputIndex = 0 + rawTx = tx.serialize() while inputIndex < len(inputs): self.get_client().startUntrustedTransaction(firstTransaction, inputIndex, chipInputs, redeemScripts[inputIndex]) - outputData = self.get_client().finalizeInputFull(txOutput) - outputData['outputData'] = txOutput + if not p2shTransaction: + outputData = self.get_client().finalizeInput(output, format_satoshis_plain(outputAmount), + format_satoshis_plain(tx.get_fee()), changePath, bytearray(rawTx.decode('hex'))) + else: + outputData = self.get_client().finalizeInputFull(txOutput) + outputData['outputData'] = txOutput + if firstTransaction: transactionOutput = outputData['outputData'] if outputData['confirmationNeeded']: