Browse Source

raise error on compressed key format

283
ThomasV 13 years ago
parent
commit
c35d48459f
  1. 3
      lib/wallet.py

3
lib/wallet.py

@ -332,7 +332,8 @@ class Wallet:
if address in self.all_addresses(): if address in self.all_addresses():
raise BaseException('Address already in wallet') raise BaseException('Address already in wallet')
b = ASecretToSecret( key ) b = ASecretToSecret( key )
if not b: return False if not b:
raise BaseException('Unsupported key format')
secexp = int( b.encode('hex'), 16) secexp = int( b.encode('hex'), 16)
private_key = ecdsa.SigningKey.from_secret_exponent( secexp, curve=SECP256k1 ) private_key = ecdsa.SigningKey.from_secret_exponent( secexp, curve=SECP256k1 )
# sanity check # sanity check

Loading…
Cancel
Save