commit cf38e1e47c80cbaff0d63edfc83276c072523cb5
parent 4f3497027d6b05664402b08c33863bfa9a492469
Author: ThomasV <thomasv@gitorious>
Date: Fri, 1 Nov 2013 13:10:27 +0100
fix: offline signing
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -432,10 +432,12 @@ class Transaction:
pubkeys = txin['pubkeys']
if not txin.get('redeemScript'):
pubkey = pubkeys[0]
- sig = signatures[0]
- sig = sig + '01' # hashtype
- script = op_push(len(sig)/2)
- script += sig
+ script = ''
+ if signatures:
+ sig = signatures[0]
+ sig = sig + '01' # hashtype
+ script += op_push(len(sig)/2)
+ script += sig
script += op_push(len(pubkey)/2)
script += pubkey
else:
@@ -720,6 +722,7 @@ class Transaction:
for i, txin in enumerate(self.inputs):
item = input_info[i]
txin['address'] = item['address']
+ txin['signatures'] = item['signatures']
txin['scriptPubKey'] = item['scriptPubKey']
txin['redeemScript'] = item.get('redeemScript')
txin['redeemPubkey'] = item.get('redeemPubkey')