Browse Source

fix bug with signatures

283
ThomasV 12 years ago
parent
commit
0cef6c2454
  1. 3
      lib/bitcoin.py
  2. 2
      lib/deserialize.py

3
lib/bitcoin.py

@ -606,7 +606,6 @@ class Transaction:
# add pubkeys
txin["pubkeys"] = redeem_pubkeys
# get list of already existing signatures
signatures = txin.get("signatures",[])
# continue if this txin is complete
@ -627,9 +626,9 @@ class Transaction:
sig = private_key.sign_digest( Hash( tx_for_sig.decode('hex') ), sigencode = ecdsa.util.sigencode_der )
assert public_key.verify_digest( sig, Hash( tx_for_sig.decode('hex') ), sigdecode = ecdsa.util.sigdecode_der)
signatures.append( sig.encode('hex') )
print_error("adding signature for", pubkey)
txin["signatures"] = signatures
print_error("signatures", signatures)
is_complete = is_complete and len(signatures) == num
self.is_complete = is_complete

2
lib/deserialize.py

@ -346,7 +346,7 @@ def get_address_from_input_script(bytes):
redeemScript = decoded[-1][1]
num = len(match) - 2
signatures = map(lambda x:x[1].encode('hex'), decoded[1:-1])
signatures = map(lambda x:x[1][:-1].encode('hex'), decoded[1:-1])
dec2 = [ x for x in script_GetOp(redeemScript) ]

Loading…
Cancel
Save