Browse Source

fix: sign tx inputs with the new low s class

283
ThomasV 9 years ago
parent
commit
19ec56b923
  1. 2
      lib/transaction.py

2
lib/transaction.py

@ -745,7 +745,7 @@ class Transaction:
for_sig = Hash(self.tx_for_sig(i).decode('hex'))
pkey = regenerate_key(sec)
secexp = pkey.secret
private_key = ecdsa.SigningKey.from_secret_exponent( secexp, curve = SECP256k1 )
private_key = bitcoin.MySigningKey.from_secret_exponent( secexp, curve = SECP256k1 )
public_key = private_key.get_verifying_key()
sig = private_key.sign_digest_deterministic( for_sig, hashfunc=hashlib.sha256, sigencode = ecdsa.util.sigencode_der )
assert public_key.verify_digest( sig, for_sig, sigdecode = ecdsa.util.sigdecode_der)

Loading…
Cancel
Save