This commit is contained in:
ThomasV 2016-10-20 08:23:10 +02:00
parent bccdab758b
commit 3f64e4d1f8
1 changed files with 5 additions and 4 deletions

View File

@ -299,11 +299,12 @@ class Ledger_KeyStore(Hardware_KeyStore):
if not p2shTransaction: if not p2shTransaction:
if len(tx.outputs()) > 2: # should never happen if len(tx.outputs()) > 2: # should never happen
self.give_error("Transaction with more than 2 outputs not supported") self.give_error("Transaction with more than 2 outputs not supported")
for i, (_type, address, amount) in enumerate(tx.outputs()): for _type, address, amount in tx.outputs():
assert _type == TYPE_ADDRESS assert _type == TYPE_ADDRESS
change, index = tx.output_info[i] info = tx.output_info.get(address)
if change: if info is not None:
changePath = "%s/%d/%d" % (self.get_derivation()[2:], change, index) index, xpubs, m = info
changePath = self.get_derivation()[2:] + "/%d/%d"%index
changeAmount = amount changeAmount = amount
else: else:
output = address output = address