electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit ad3ba3d066330790f295f3edcb395f6ad3369f45
parent 7939b32a1f8aadaf4d726d00f526fea374068496
Author: ThomasV <thomasv@electrum.org>
Date:   Sun, 25 Mar 2018 10:34:15 +0200

Merge pull request #4171 from SomberNight/ledger_txoutput_hack

ledger: send derivation for change output
Diffstat:
Mplugins/ledger/ledger.py | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/plugins/ledger/ledger.py b/plugins/ledger/ledger.py @@ -418,7 +418,12 @@ class Ledger_KeyStore(Hardware_KeyStore): if segwitTransaction: self.get_client().startUntrustedTransaction(True, inputIndex, chipInputs, redeemScripts[inputIndex]) - outputData = self.get_client().finalizeInputFull(txOutput) + if changePath: + # we don't set meaningful outputAddress, amount and fees + # as we only care about the alternateEncoding==True branch + outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx)) + else: + outputData = self.get_client().finalizeInputFull(txOutput) outputData['outputData'] = txOutput transactionOutput = outputData['outputData'] if outputData['confirmationNeeded']: @@ -441,7 +446,12 @@ class Ledger_KeyStore(Hardware_KeyStore): while inputIndex < len(inputs): self.get_client().startUntrustedTransaction(firstTransaction, inputIndex, chipInputs, redeemScripts[inputIndex]) - outputData = self.get_client().finalizeInputFull(txOutput) + if changePath: + # we don't set meaningful outputAddress, amount and fees + # as we only care about the alternateEncoding==True branch + outputData = self.get_client().finalizeInput(b'', 0, 0, changePath, bfh(rawTx)) + else: + outputData = self.get_client().finalizeInputFull(txOutput) outputData['outputData'] = txOutput if firstTransaction: transactionOutput = outputData['outputData']