commit df59c8e0130067e2bce6aa1120bfcbc859a97eda
parent 8b7c3a201cc599e1cccaa496e3d05c12cb26e5a8
Author: ThomasV <thomasv@gitorious>
Date: Thu, 17 Apr 2014 18:41:34 +0200
fix #563
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -314,6 +314,8 @@ def get_address_from_input_script(bytes):
match = [ opcodes.OP_PUSHDATA4, opcodes.OP_PUSHDATA4 ]
if match_decoded(decoded, match):
sig = decoded[0][1].encode('hex')
+ assert sig[-2:] == '01'
+ sig = sig[:-2]
pubkey = decoded[1][1].encode('hex')
return [pubkey], {pubkey:sig}, public_key_to_bc_address(pubkey.decode('hex'))
@@ -386,7 +388,7 @@ class Transaction:
@classmethod
def from_io(klass, inputs, outputs):
- raw = klass.serialize(inputs, outputs, for_sig = -1) # for_sig=-1 means do not sign
+ raw = klass.serialize(inputs, outputs, for_sig = None) # for_sig=-1 means do not sign
self = klass(raw)
self.inputs = inputs
self.outputs = outputs
@@ -591,6 +593,7 @@ class Transaction:
address = None
d['address'] = address
+ d['pubkeys'] = pubkeys
d['signatures'] = signatures
return d