commit 5ee4cf41a83cb429f7f95094932076705a847cfd
parent f99fbbe488a978d557e131ea5b29ddee8533ba6b
Author: ThomasV <thomasv@electrum.org>
Date: Sun, 5 Mar 2017 16:14:13 +0100
fix #2242
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -813,7 +813,7 @@ class Transaction:
def sign(self, keypairs):
- for i, txin in enumerate(self._inputs):
+ for i, txin in enumerate(self.inputs()):
num = txin['num_sig']
pubkeys, x_pubkeys = self.get_sorted_pubkeys(txin)
for j, x_pubkey in enumerate(x_pubkeys):
@@ -821,9 +821,10 @@ class Transaction:
if len(signatures) == num:
# txin is complete
break
- if x_pubkey in keypairs.keys():
+ fd_key = 'fd00' + bitcoin.hash_160(pubkeys[j].decode('hex')).encode('hex')
+ if x_pubkey in keypairs.keys() or fd_key in keypairs.keys():
print_error("adding signature for", x_pubkey)
- sec = keypairs[x_pubkey]
+ sec = keypairs.get(x_pubkey) or keypairs.get(fd)
pubkey = public_key_from_private_key(sec)
assert pubkey == pubkeys[j]
# add signature